diff options
Diffstat (limited to 'spec/rubocop/cop/destroy_all_spec.rb')
-rw-r--r-- | spec/rubocop/cop/destroy_all_spec.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/rubocop/cop/destroy_all_spec.rb b/spec/rubocop/cop/destroy_all_spec.rb index 468b10c3816..f984822a4e8 100644 --- a/spec/rubocop/cop/destroy_all_spec.rb +++ b/spec/rubocop/cop/destroy_all_spec.rb @@ -1,21 +1,19 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'rubocop_spec_helper' require_relative '../../../rubocop/cop/destroy_all' RSpec.describe RuboCop::Cop::DestroyAll do - subject(:cop) { described_class.new } - it 'flags the use of destroy_all with a send receiver' do expect_offense(<<~CODE) - foo.destroy_all # rubocop: disable Cop/DestroyAll + foo.destroy_all ^^^^^^^^^^^^^^^ Use `delete_all` instead of `destroy_all`. [...] CODE end it 'flags the use of destroy_all with a constant receiver' do expect_offense(<<~CODE) - User.destroy_all # rubocop: disable Cop/DestroyAll + User.destroy_all ^^^^^^^^^^^^^^^^ Use `delete_all` instead of `destroy_all`. [...] CODE end @@ -30,7 +28,7 @@ RSpec.describe RuboCop::Cop::DestroyAll do it 'flags the use of destroy_all with a local variable receiver' do expect_offense(<<~CODE) users = User.all - users.destroy_all # rubocop: disable Cop/DestroyAll + users.destroy_all ^^^^^^^^^^^^^^^^^ Use `delete_all` instead of `destroy_all`. [...] CODE end |