blob: 37fec7cb62ac8a2306e9575dd6eaa49d6b6c26aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# frozen_string_literal: true
require 'fast_spec_helper'
require 'rubocop'
require_relative '../../../rubocop/cop/ignored_columns'
RSpec.describe RuboCop::Cop::IgnoredColumns do
subject(:cop) { described_class.new }
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
end
end
|