aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Nayden <alexey.nayden@gmail.com>2011-01-13 03:50:37 +0300
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-28 15:06:02 -0800
commitfa779c5357fd9396644ffc46e8ec575444f2f029 (patch)
treef94d714c0fefd47cff1d1a3d8d5394b2c4c9b13e
parente92c2ffd8eebf4b0b1f260cfe77c0d9690ba8fef (diff)
downloadrails-fa779c5357fd9396644ffc46e8ec575444f2f029.tar.gz
rails-fa779c5357fd9396644ffc46e8ec575444f2f029.tar.bz2
rails-fa779c5357fd9396644ffc46e8ec575444f2f029.zip
Fixing incorrectly writtent testcase
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb
index ef25bde87e..d1afe7376a 100644
--- a/activerecord/test/cases/nested_attributes_test.rb
+++ b/activerecord/test/cases/nested_attributes_test.rb
@@ -151,8 +151,8 @@ class TestNestedAttributesInGeneral < ActiveRecord::TestCase
def test_first_and_array_index_zero_methods_return_the_same_value_when_nested_attributes_are_set_to_update_existing_record
Man.accepts_nested_attributes_for(:interests)
man = Man.create(:name => "John")
- interest = Interest.create :topic => 'gardning', :man => man
- man = Man.first
+ interest = man.interests.create :topic => 'gardning'
+ man = Man.find man.id
man.interests_attributes = [{:id => interest.id, :topic => 'gardening'}]
assert_equal man.interests.first.topic, man.interests[0].topic
end