aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/scoping/named_scoping_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-03-20 11:50:18 -0400
committerGitHub <noreply@github.com>2017-03-20 11:50:18 -0400
commit30fd30e7ece79c2f4cbd6c0b6cd74471c652423e (patch)
tree3ec793f6f08743afb007a82cf3a0fa7cf6755da4 /activerecord/test/cases/scoping/named_scoping_test.rb
parentd4c3db0d27e68e6c2c43b7aaa4e7c49cb98bab27 (diff)
parent59db5f22927135639d1fd77ea496ef1fb1679429 (diff)
downloadrails-30fd30e7ece79c2f4cbd6c0b6cd74471c652423e.tar.gz
rails-30fd30e7ece79c2f4cbd6c0b6cd74471c652423e.tar.bz2
rails-30fd30e7ece79c2f4cbd6c0b6cd74471c652423e.zip
Merge pull request #28473 from kamipo/delegate_uniq_to_records
Delegate `uniq` to `records`
Diffstat (limited to 'activerecord/test/cases/scoping/named_scoping_test.rb')
-rw-r--r--activerecord/test/cases/scoping/named_scoping_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb
index d261fd5321..0c2cffe0d3 100644
--- a/activerecord/test/cases/scoping/named_scoping_test.rb
+++ b/activerecord/test/cases/scoping/named_scoping_test.rb
@@ -23,8 +23,8 @@ class NamedScopingTest < ActiveRecord::TestCase
all_posts = Topic.base
assert_queries(1) do
- all_posts.collect
- all_posts.collect
+ all_posts.collect { true }
+ all_posts.collect { true }
end
end
@@ -167,7 +167,7 @@ class NamedScopingTest < ActiveRecord::TestCase
def test_first_and_last_should_not_use_query_when_results_are_loaded
topics = Topic.base
- topics.reload # force load
+ topics.load # force load
assert_no_queries do
topics.first
topics.last
@@ -178,7 +178,7 @@ class NamedScopingTest < ActiveRecord::TestCase
topics = Topic.base
assert_queries(2) do
topics.empty? # use count query
- topics.collect # force load
+ topics.load # force load
topics.empty? # use loaded (no query)
end
end
@@ -187,7 +187,7 @@ class NamedScopingTest < ActiveRecord::TestCase
topics = Topic.base
assert_queries(2) do
topics.any? # use count query
- topics.collect # force load
+ topics.load # force load
topics.any? # use loaded (no query)
end
end
@@ -203,7 +203,7 @@ class NamedScopingTest < ActiveRecord::TestCase
def test_any_should_not_fire_query_if_scope_loaded
topics = Topic.base
- topics.collect # force load
+ topics.load # force load
assert_no_queries { assert topics.any? }
end
@@ -217,7 +217,7 @@ class NamedScopingTest < ActiveRecord::TestCase
topics = Topic.base
assert_queries(2) do
topics.many? # use count query
- topics.collect # force load
+ topics.load # force load
topics.many? # use loaded (no query)
end
end
@@ -233,7 +233,7 @@ class NamedScopingTest < ActiveRecord::TestCase
def test_many_should_not_fire_query_if_scope_loaded
topics = Topic.base
- topics.collect # force load
+ topics.load # force load
assert_no_queries { assert topics.many? }
end
@@ -384,7 +384,7 @@ class NamedScopingTest < ActiveRecord::TestCase
def test_size_should_use_length_when_results_are_loaded
topics = Topic.base
- topics.reload # force load
+ topics.load # force load
assert_no_queries do
topics.size # use loaded (no query)
end