From ccb335da1f293dc745be0171ce3d95e50223d934 Mon Sep 17 00:00:00 2001 From: Marcin Raczkowski Date: Sun, 29 Aug 2010 12:04:43 +0200 Subject: IdentityMap - Adjustments to test cases --- activerecord/test/cases/autosave_association_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activerecord/test/cases/autosave_association_test.rb') diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index b13cb2d7a2..59fc13fe51 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -578,7 +578,7 @@ class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase @pirate.ship.mark_for_destruction assert !@pirate.reload.marked_for_destruction? - assert !@pirate.ship.marked_for_destruction? + assert !@pirate.ship.target.reload.marked_for_destruction? end # has_one @@ -1194,6 +1194,7 @@ class TestAutosaveAssociationValidationsOnAHasOneAssociation < ActiveRecord::Tes self.use_transactional_fixtures = false def setup + ActiveRecord::IdentityMap.enabled = false # This tests use trick with double association, IM prevents that, so we disable it. @pirate = Pirate.create(:catchphrase => "Don' botharrr talkin' like one, savvy?") @pirate.create_ship(:name => 'titanic') end @@ -1209,6 +1210,10 @@ class TestAutosaveAssociationValidationsOnAHasOneAssociation < ActiveRecord::Tes @pirate.non_validated_ship.name = '' assert @pirate.valid? end + + def teardown + ActiveRecord::IdentityMap.enabled = true + end end class TestAutosaveAssociationValidationsOnABelongsToAssociation < ActiveRecord::TestCase -- cgit v1.2.3