diff options
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-x | activerecord/test/associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 9e4d0f2711..f912816f33 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -595,6 +595,13 @@ class HasManyAssociationsTest < Test::Unit::TestCase end end + def test_create_with_bang_on_has_many_raises_when_record_not_saved + assert_raises(ActiveRecord::RecordInvalid) do + firm = Firm.find(:first) + firm.plain_clients.create! + end + end + def test_create_with_bang_on_habtm_when_parent_is_new_raises assert_raises(ActiveRecord::RecordNotSaved) do Developer.new("name" => "Aredridel").projects.create! |