aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb4
-rw-r--r--activerecord/test/cases/relations_test.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index cfcd11ca46..f33e765c59 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -548,4 +548,8 @@ class DefaultScopingTest < ActiveRecord::TestCase
end
threads.each(&:join)
end
+
+ def test_default_scope_unscoped_is_not_cached
+ assert_not_equal DeveloperCalledDavid.unscoped.object_id, DeveloperCalledDavid.unscoped.object_id
+ end
end
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 7639585649..b24df47efd 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -1093,6 +1093,10 @@ class RelationTest < ActiveRecord::TestCase
assert_equal 'honda', FastCar.unscoped { FastCar.order_using_old_style.limit(1).first.name}
end
+ def test_unscoped_relation_clones
+ assert_not_equal CoolCar.unscoped.object_id, CoolCar.unscoped.object_id
+ end
+
def test_intersection_with_array
relation = Author.where(:name => "David")
rails_author = relation.first