mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
@@ -624,9 +624,13 @@ module NestedAttributesOnACollectionAssociationTests
|
||||
end
|
||||
|
||||
def test_should_automatically_build_new_associated_models_for_each_entry_in_a_hash_where_the_id_is_missing
|
||||
attributes = ActiveSupport::OrderedHash.new
|
||||
attributes['foo'] = { :name => 'Grace OMalley' }
|
||||
attributes['bar'] = { :name => 'Privateers Greed' }
|
||||
|
||||
@pirate.send(@association_name).destroy_all
|
||||
@pirate.reload.attributes = {
|
||||
association_getter => { 'foo' => { :name => 'Grace OMalley' }, 'bar' => { :name => 'Privateers Greed' }}
|
||||
association_getter => attributes
|
||||
}
|
||||
|
||||
assert !@pirate.send(@association_name).first.persisted?
|
||||
|
||||
Reference in New Issue
Block a user