aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/nested_attributes_test.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-07-08 10:09:39 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2010-07-08 10:09:39 -0400
commit4a1207d54077348b67fad95ffde5710cf0be31bd (patch)
treede721528fa81f1dfe50449c2d5c3985f513e83cd /activerecord/test/cases/nested_attributes_test.rb
parentf6fa6cf6117e691899c821b8999bd7dfb3f48b38 (diff)
parentdc364fdc595405aa3d5735e60d46ad3f9544a65b (diff)
downloadrails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.gz
rails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.bz2
rails-4a1207d54077348b67fad95ffde5710cf0be31bd.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activerecord/test/cases/nested_attributes_test.rb')
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb
index 3c797076e0..62237f955b 100644
--- a/activerecord/test/cases/nested_attributes_test.rb
+++ b/activerecord/test/cases/nested_attributes_test.rb
@@ -489,6 +489,12 @@ module NestedAttributesOnACollectionAssociationTests
assert_equal 'Polly', @pirate.send(@association_name).send(:load_target).last.name
end
+ def test_should_not_remove_scheduled_destroys_when_loading_association
+ @pirate.reload
+ @pirate.send(association_setter, [{ :id => @child_1.id, :_destroy => '1' }])
+ assert @pirate.send(@association_name).send(:load_target).find { |r| r.id == @child_1.id }.marked_for_destruction?
+ end
+
def test_should_take_a_hash_with_composite_id_keys_and_assign_the_attributes_to_the_associated_models
@child_1.stubs(:id).returns('ABC1X')
@child_2.stubs(:id).returns('ABC2X')