Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop/ignored_columns_spec.rb')
-rw-r--r--spec/rubocop/cop/ignored_columns_spec.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/rubocop/cop/ignored_columns_spec.rb b/spec/rubocop/cop/ignored_columns_spec.rb
index 38b4ac0bc1a..1c72fedbf31 100644
--- a/spec/rubocop/cop/ignored_columns_spec.rb
+++ b/spec/rubocop/cop/ignored_columns_spec.rb
@@ -1,22 +1,17 @@
# frozen_string_literal: true
require 'fast_spec_helper'
-require 'rubocop'
-require 'rubocop/rspec/support'
require_relative '../../../rubocop/cop/ignored_columns'
RSpec.describe RuboCop::Cop::IgnoredColumns do
- include CopHelper
-
subject(:cop) { described_class.new }
- it 'flags the use of destroy_all with a local variable receiver' do
- inspect_source(<<~RUBY)
+ it 'flags direct use of ignored_columns instead of the IgnoredColumns concern' do
+ expect_offense(<<~RUBY)
class Foo < ApplicationRecord
self.ignored_columns += %i[id]
+ ^^^^^^^^^^^^^^^^^^^^ Use `IgnoredColumns` concern instead of adding to `self.ignored_columns`.
end
RUBY
-
- expect(cop.offenses.size).to eq(1)
end
end