From 4b96dd7962a052af17b9c3a1fe39f4269c4f96c9 Mon Sep 17 00:00:00 2001 From: Jens Lukowski Date: Sat, 28 Jan 2012 22:54:55 +0100 Subject: failing test case for Issue 4718 --- activerecord/test/cases/identity_map_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test') 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 # -- cgit v1.2.3