daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Aug 15th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'test_helper'
  2.  
  3. class PostTest < ActiveSupport::TestCase
  4.   test "using delete deletes objects despite callbacks" do
  5.     post = Post.create
  6.     post.delete
  7.     assert_equal Post.first, nil
  8.   end
  9.  
  10.   test "using destroy respects callback" do
  11.     post = Post.create
  12.     post.destroy
  13.     assert_equal post.errors[:base][0], "Whoa this one is important"
  14.     assert_equal post, Post.first
  15.   end
  16. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top