diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 381249c..5db936b 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -392,6 +392,25 @@ class TestAutosaveAssociationOnAHasManyAssociation < ActiveRecord::TestCase include AutosaveAssociationOnACollectionAssociationTests end +class TestAutosaveAssociationOnAHasManyAssociationWoValidation < ActiveRecord::TestCase + self.use_transactional_fixtures = false + + def setup + @association_name = :birds + + @pirate = Pirate.create(:catchphrase => "Don' botharrr talkin' like one, savvy?") + end + + def test_should_create_associated_object_through_attributes_without_validation + assert_difference 'Bird.count' do + attrs = { "birds_attributes" => { "new_1" => { "name" => "" } } } + @pirate.attributes = attrs + @pirate.save(false) + end + end + +end + class TestAutosaveAssociationOnAHasAndBelongsToManyAssociation < ActiveRecord::TestCase self.use_transactional_fixtures = false @@ -405,4 +424,4 @@ class TestAutosaveAssociationOnAHasAndBelongsToManyAssociation < ActiveRecord::T end include AutosaveAssociationOnACollectionAssociationTests -end \ No newline at end of file +end