daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Aug 15th, 2018 70 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  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