Skip to content
Browse files

Run backported serialized test without Identity Map

It fails with Identity Map because the find call returns the same
object, so the "content" attribute that we expect to raise "missing
attribute" is actually present.
  • Loading branch information...
1 parent 454f112 commit 87a7e8752dcba5179f75a77b000d2e7eec29c736 @carlosantoniodasilva carlosantoniodasilva committed Dec 11, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/test/cases/base_test.rb
View
6 activerecord/test/cases/base_test.rb
@@ -1449,8 +1449,10 @@ def test_serialize_attribute_via_select_method_when_time_zone_available
myobj = MyObject.new('value1', 'value2')
topic = Topic.create(:content => myobj)
- assert_equal(myobj, Topic.select(:content).find(topic.id).content)
- assert_raise(ActiveModel::MissingAttributeError) { Topic.select(:id).find(topic.id).content }
+ ActiveRecord::IdentityMap.without do
+ assert_equal(myobj, Topic.select(:content).find(topic.id).content)
+ assert_raise(ActiveModel::MissingAttributeError) { Topic.select(:id).find(topic.id).content }
+ end
ensure
ActiveRecord::Base.time_zone_aware_attributes = false
end

0 comments on commit 87a7e87

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