diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-10 10:40:11 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-10 10:40:11 -0300 |
commit | eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413 (patch) | |
tree | 9997bd3739e30fad0102a22e8feee40c4c4c835c /activerecord/test | |
parent | 952014315926d370f2a0b681cb765948bf2e6883 (diff) | |
parent | 5786395760f1e1906c878df4023cac3741e66e87 (diff) | |
download | rails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.tar.gz rails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.tar.bz2 rails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.zip |
Merge commit 'rails/master'
Conflicts:
activerecord/lib/active_record/migration.rb
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 8529ff0285..f6b4a42377 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -169,6 +169,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase assert_equal peeps + 1, posts(:thinking).people.count end + def test_create_on_new_record + p = Post.new + + assert_raises(ActiveRecord::RecordNotSaved) { p.people.create(:first_name => "mew") } + assert_raises(ActiveRecord::RecordNotSaved) { p.people.create!(:first_name => "snow") } + end + def test_clear_associations assert_queries(2) { posts(:welcome);posts(:welcome).people(true) } |