Skip to content
This repository
Browse code

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

…d on or off
  • Loading branch information...
commit d53b406a76db291f9d1ef15685f87a0977f16c89 1 parent 564922b
Richard Millan authored May 05, 2011
16  activerecord/test/cases/identity_map_test.rb
@@ -133,6 +133,22 @@ def test_creation
133 133
   # types of inheritance                                                       #
134 134
   ##############################################################################
135 135
 
  136
+  def test_inherited_without_type_attribute_without_identity_map
  137
+    ActiveRecord::IdentityMap.without do
  138
+      p1 = DestructivePirate.create!(:catchphrase => "I'm not a regular Pirate")
  139
+      p2 = Pirate.find(p1.id)
  140
+      assert_not_same(p1, p2)
  141
+    end
  142
+  end
  143
+  
  144
+  def test_inherited_with_type_attribute_without_identity_map
  145
+    ActiveRecord::IdentityMap.without do
  146
+      c1 = comments(:sub_special_comment)
  147
+      c2 = Comment.find(c1.id)
  148
+      assert_same(c1.class, c2.class)
  149
+    end
  150
+  end
  151
+
136 152
   def test_inherited_without_type_attribute
137 153
     p1 = DestructivePirate.create!(:catchphrase => "I'm not a regular Pirate")
138 154
     p2 = Pirate.find(p1.id)

0 notes on commit d53b406

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