Refactoring: Agora o sistema se comporta bem com objetos excluidos

This commit is contained in:
2008-03-15 07:44:46 -03:00
parent 8d02e0d4ce
commit 4c55ce7b45
16 changed files with 114 additions and 96 deletions

View File

@@ -234,4 +234,14 @@ class UserTest < Test::Unit::TestCase
assert_not_equal "I-want-to-set-my-salt", u.salt
assert_equal "verybadbob", u.login
end
def test_paranoid
assert User.paranoid?
u = users(:bob)
u.destroy
assert_raises(ActiveRecord::RecordNotFound) { User.find(u.id) }
assert_nothing_raised { User.find_with_deleted(u.id) }
end
end