diff options
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/validations_test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb index be5d1fab70..f0d75c96cf 100755 --- a/activerecord/test/validations_test.rb +++ b/activerecord/test/validations_test.rb @@ -76,8 +76,16 @@ class ValidationsTest < Test::Unit::TestCase end def test_invalid_record_exception - r = Reply.new - assert_raises(ActiveRecord::RecordInvalid) { r.save! } + assert_raises(ActiveRecord::RecordInvalid) { Reply.create! } + assert_raises(ActiveRecord::RecordInvalid) { Reply.new.save! } + + begin + r = Reply.new + r.save! + flunk + rescue ActiveRecord::RecordInvalid => invalid + assert_equal r, invalid.record + end end def test_single_error_per_attr_iteration |