diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-11 13:10:09 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-11 13:10:10 -0200 |
commit | 87a7e8752dcba5179f75a77b000d2e7eec29c736 (patch) | |
tree | 4fe7e039a6d04026c751a2f97d0bfd55cfc7899d /activerecord/test/cases | |
parent | 454f1127056a47cadaba1725694f29d3007ab094 (diff) | |
download | rails-87a7e8752dcba5179f75a77b000d2e7eec29c736.tar.gz rails-87a7e8752dcba5179f75a77b000d2e7eec29c736.tar.bz2 rails-87a7e8752dcba5179f75a77b000d2e7eec29c736.zip |
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.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index efcfe3f612..5631ac9ce2 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1449,8 +1449,10 @@ class BasicsTest < ActiveRecord::TestCase 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 |