diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/rubocop/cop/performance/ar_count_each_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/rubocop/cop/performance/ar_count_each_spec.rb')
-rw-r--r-- | spec/rubocop/cop/performance/ar_count_each_spec.rb | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/spec/rubocop/cop/performance/ar_count_each_spec.rb b/spec/rubocop/cop/performance/ar_count_each_spec.rb index 6242c7a4c5e..402e3e93147 100644 --- a/spec/rubocop/cop/performance/ar_count_each_spec.rb +++ b/spec/rubocop/cop/performance/ar_count_each_spec.rb @@ -5,8 +5,6 @@ require 'rubocop' require_relative '../../../../rubocop/cop/performance/ar_count_each.rb' RSpec.describe RuboCop::Cop::Performance::ARCountEach do - include CopHelper - subject(:cop) { described_class.new } context 'when it is not haml file' do @@ -32,8 +30,6 @@ RSpec.describe RuboCop::Cop::Performance::ARCountEach do ^^^^^^^^^^^^ If @users is AR relation, avoid `@users.count ...; @users.each... `, this will trigger two queries. Use `@users.load.size ...; @users.each... ` instead. If @users is an array, try to use @users.size. @users.each { |user| display(user) } SOURCE - - expect(cop.offenses.map(&:cop_name)).to contain_exactly('Performance/ARCountEach') end end |