diff options
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 |