diff options
author | Marcin Raczkowski <marcin.raczkowski@gmail.com> | 2010-08-28 18:47:39 +0200 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:03:56 -0300 |
commit | ce3ea558ab509624a1c8d8499408f52ebb4bbe2b (patch) | |
tree | 62d7bdf583f11f0932a7dd15ac10216446d2bf00 /activerecord/lib/active_record | |
parent | 3df4460a742c18af8cc71e41009c9028467d16b5 (diff) | |
download | rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.tar.gz rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.tar.bz2 rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.zip |
IdentityMap - Tests for IM
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/test_case.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/test_case.rb b/activerecord/lib/active_record/test_case.rb index 014a900c71..c7557fb224 100644 --- a/activerecord/lib/active_record/test_case.rb +++ b/activerecord/lib/active_record/test_case.rb @@ -3,6 +3,13 @@ module ActiveRecord # # Defines some test assertions to test against SQL queries. class TestCase < ActiveSupport::TestCase #:nodoc: + setup :cleanup_identity_map + + def cleanup_identity_map + ActiveRecord::IdentityMap.current_repository_name = :test + ActiveRecord::Base.identity_map.clear + end + def assert_date_from_db(expected, actual, message = nil) # SybaseAdapter doesn't have a separate column type just for dates, # so the time is in the string and incorrectly formatted |