diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/cases/identity_map_test.rb | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 00a6d97928..6c3e4fc6d0 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1104,7 +1104,10 @@ class BasicsTest < ActiveRecord::TestCase # TODO: extend defaults tests to other databases! if current_adapter?(:PostgreSQLAdapter) def test_default + tz = Default.default_timezone + Default.default_timezone = :local default = Default.new + Default.default_timezone = tz # fixed dates / times assert_equal Date.new(2004, 1, 1), default.fixed_date diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb index 3efc8bf559..0d031d433c 100644 --- a/activerecord/test/cases/identity_map_test.rb +++ b/activerecord/test/cases/identity_map_test.rb @@ -162,6 +162,14 @@ class IdentityMapTest < ActiveRecord::TestCase c2 = Comment.find(c.id) assert_same(c1, c2) end + + def test_queries_are_not_executed_when_finding_inherited_class_by_id + c = comments(:sub_special_comment) + SubSpecialComment.find(c.id) + assert_no_queries do + SubSpecialComment.find(c.id) + end + end ############################################################################## # Tests checking dirty attribute behavior with IM # |