diff options
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index dc2481456b..5a414c49f1 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -86,11 +86,20 @@ class HasManyAssociationsTest < ActiveRecord::TestCase bulb = car.bulbs.new assert_equal car.id, bulb.car_id + bulb = car.bulbs.new :car_id => car.id + 1 + assert_equal car.id, bulb.car_id + bulb = car.bulbs.build assert_equal car.id, bulb.car_id + bulb = car.bulbs.build :car_id => car.id + 1 + assert_equal car.id, bulb.car_id + bulb = car.bulbs.create assert_equal car.id, bulb.car_id + + bulb = car.bulbs.create :car_id => car.id + 1 + assert_equal car.id, bulb.car_id ensure Bulb.attr_protected :id end |