Skip to content
Browse files

Test: identity on inherited classes should behave the same when turne…

…d on or off
  • Loading branch information...
1 parent 564922b commit d53b406a76db291f9d1ef15685f87a0977f16c89 @richardiux committed May 5, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 activerecord/test/cases/identity_map_test.rb
View
16 activerecord/test/cases/identity_map_test.rb
@@ -133,6 +133,22 @@ def test_creation
# types of inheritance #
##############################################################################
+ def test_inherited_without_type_attribute_without_identity_map
+ ActiveRecord::IdentityMap.without do
+ p1 = DestructivePirate.create!(:catchphrase => "I'm not a regular Pirate")
+ p2 = Pirate.find(p1.id)
+ assert_not_same(p1, p2)
+ end
+ end
+
+ def test_inherited_with_type_attribute_without_identity_map
+ ActiveRecord::IdentityMap.without do
+ c1 = comments(:sub_special_comment)
+ c2 = Comment.find(c1.id)
+ assert_same(c1.class, c2.class)
+ end
+ end
+
def test_inherited_without_type_attribute
p1 = DestructivePirate.create!(:catchphrase => "I'm not a regular Pirate")
p2 = Pirate.find(p1.id)

0 comments on commit d53b406

Please sign in to comment.
Something went wrong with that request. Please try again.