diff options
Diffstat (limited to 'spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb')
-rw-r--r-- | spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb index e95220756ed..070e792eeec 100644 --- a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb +++ b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb @@ -1,14 +1,12 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'rubocop_spec_helper' require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank' RSpec.describe RuboCop::Cop::Performance::ARExistsAndPresentBlank do - subject(:cop) { described_class.new } - context 'when it is not haml file' do it 'does not flag it as an offense' do - expect(subject).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(false) + expect(cop).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(false) expect_no_offenses <<~SOURCE return unless @users.exists? @@ -19,7 +17,7 @@ RSpec.describe RuboCop::Cop::Performance::ARExistsAndPresentBlank do context 'when it is haml file' do before do - expect(subject).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(true) + expect(cop).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(true) end context 'the same object uses exists? and present?' do |