Guest User

Untitled

a guest
Aug 15th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment