aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/named_scope_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb
index e21ffbbdba..7bd712e11e 100644
--- a/activerecord/test/cases/named_scope_test.rb
+++ b/activerecord/test/cases/named_scope_test.rb
@@ -186,9 +186,10 @@ class NamedScopeTest < ActiveRecord::TestCase
def test_any_should_not_load_results
topics = Topic.base
- assert_queries(1) do
- topics.expects(:empty?).returns(true)
- assert !topics.any?
+ assert_queries(2) do
+ topics.any? # use count query
+ topics.collect # force load
+ topics.any? # use loaded (no query)
end
end