aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/readonly_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/readonly_test.rb')
-rw-r--r--activerecord/test/cases/readonly_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/readonly_test.rb b/activerecord/test/cases/readonly_test.rb
index 98011f40a4..448c8f8796 100644
--- a/activerecord/test/cases/readonly_test.rb
+++ b/activerecord/test/cases/readonly_test.rb
@@ -40,6 +40,10 @@ class ReadOnlyTest < ActiveRecord::TestCase
def test_find_with_joins_option_implies_readonly
+ # We disable IM, becouse we want to check default settings here
+ # adding readonly(false) does not update readonly status with IM
+ # (see corresponding test in IM)
+ ActiveRecord::IdentityMap.without do
# Blank joins don't count.
Developer.joins(' ').each { |d| assert !d.readonly? }
Developer.joins(' ').readonly(false).each { |d| assert !d.readonly? }
@@ -47,6 +51,7 @@ class ReadOnlyTest < ActiveRecord::TestCase
# Others do.
Developer.joins(', projects').each { |d| assert d.readonly? }
Developer.joins(', projects').readonly(false).each { |d| assert !d.readonly? }
+ end
end
@@ -72,6 +77,10 @@ class ReadOnlyTest < ActiveRecord::TestCase
end
def test_readonly_scoping
+ # We disable IM, becouse we want to check default settings here
+ # adding readonly(false) does not update readonly status with IM
+ # (see corresponding test in IM)
+ ActiveRecord::IdentityMap.without do
Post.send(:with_scope, :find => { :conditions => '1=1' }) do
assert !Post.find(1).readonly?
assert Post.readonly(true).find(1).readonly?
@@ -99,6 +108,7 @@ class ReadOnlyTest < ActiveRecord::TestCase
assert Post.readonly.find(1).readonly?
assert !Post.readonly(false).find(1).readonly?
end
+ end
end
def test_association_collection_method_missing_scoping_not_readonly