Skip to content
This repository
Browse code

Merge pull request #5081 from arunagw/fix_ar_test

Fix ar test
  • Loading branch information...
commit 3b61efc4af1b4af6ceec45f2e0999746335e9ffa 2 parents 1b4e6ca + 742b615
Xavier Noria authored February 18, 2012
6  activerecord/test/cases/nested_attributes_test.rb
@@ -624,9 +624,13 @@ def test_should_raise_RecordNotFound_if_an_id_is_given_but_doesnt_return_a_recor
624 624
   end
625 625
 
626 626
   def test_should_automatically_build_new_associated_models_for_each_entry_in_a_hash_where_the_id_is_missing
  627
+    attributes = ActiveSupport::OrderedHash.new
  628
+    attributes['foo'] = { :name => 'Grace OMalley' }
  629
+    attributes['bar'] = { :name => 'Privateers Greed' }
  630
+
627 631
     @pirate.send(@association_name).destroy_all
628 632
     @pirate.reload.attributes = {
629  
-      association_getter => { 'foo' => { :name => 'Grace OMalley' }, 'bar' => { :name => 'Privateers Greed' }}
  633
+      association_getter => attributes
630 634
     }
631 635
 
632 636
     assert !@pirate.send(@association_name).first.persisted?

0 notes on commit 3b61efc

Please sign in to comment.
Something went wrong with that request. Please try again.