aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-16 05:07:58 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-16 05:07:58 +0000
commita72c1ec43ea91c1dd9b37870c77e82da7cc2f5d8 (patch)
tree8b1bba3f8c93025c8c6e57a15c94dcf3443cc888 /activerecord/test/associations_test.rb
parent5cb6a9aabdd2d74b7c8b52828f6b4797714ce78b (diff)
downloadrails-a72c1ec43ea91c1dd9b37870c77e82da7cc2f5d8.tar.gz
rails-a72c1ec43ea91c1dd9b37870c77e82da7cc2f5d8.tar.bz2
rails-a72c1ec43ea91c1dd9b37870c77e82da7cc2f5d8.zip
Refactor association create and build so before & after callbacks behave consistently. Closes #8854.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb7
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!