Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'test_helper'
- class PostTest < ActiveSupport::TestCase
- test "using delete deletes objects despite callbacks" do
- post = Post.create
- post.delete
- assert_equal Post.first, nil
- end
- test "using destroy respects callback" do
- post = Post.create
- post.destroy
- assert_equal post.errors[:base][0], "Whoa this one is important"
- assert_equal post, Post.first
- end
- end
Add Comment
Please, Sign In to add comment