diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 21:09:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 21:09:35 +0300 |
commit | 5bfb8d1fad825eec90b0af688c7cd1b352c9056e (patch) | |
tree | 385411919c4186d11a769385ad8dafeef6cc36a7 /spec/rubocop/cop/migration | |
parent | aaf59610548d9b0fd01acfd50e831cbe519ecba2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop/cop/migration')
-rw-r--r-- | spec/rubocop/cop/migration/safer_boolean_column_spec.rb | 8 | ||||
-rw-r--r-- | spec/rubocop/cop/migration/update_large_table_spec.rb | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/rubocop/cop/migration/safer_boolean_column_spec.rb b/spec/rubocop/cop/migration/safer_boolean_column_spec.rb index 915b73ed5a7..b27a4cd4f80 100644 --- a/spec/rubocop/cop/migration/safer_boolean_column_spec.rb +++ b/spec/rubocop/cop/migration/safer_boolean_column_spec.rb @@ -17,7 +17,7 @@ describe RuboCop::Cop::Migration::SaferBooleanColumn do allow(cop).to receive(:in_migration?).and_return(true) end - described_class::SMALL_TABLES.each do |table| + described_class::WHITELISTED_TABLES.each do |table| context "for the #{table} table" do sources_and_offense = [ ["add_column :#{table}, :column, :boolean, default: true", 'should disallow nulls'], @@ -62,14 +62,14 @@ describe RuboCop::Cop::Migration::SaferBooleanColumn do end end - it 'registers no offense for tables not listed in SMALL_TABLES' do + it 'registers no offense for tables not listed in WHITELISTED_TABLES' do inspect_source("add_column :large_table, :column, :boolean") expect(cop.offenses).to be_empty end it 'registers no offense for non-boolean columns' do - table = described_class::SMALL_TABLES.sample + table = described_class::WHITELISTED_TABLES.sample inspect_source("add_column :#{table}, :column, :string") expect(cop.offenses).to be_empty @@ -78,7 +78,7 @@ describe RuboCop::Cop::Migration::SaferBooleanColumn do context 'outside of migration' do it 'registers no offense' do - table = described_class::SMALL_TABLES.sample + table = described_class::WHITELISTED_TABLES.sample inspect_source("add_column :#{table}, :column, :boolean") expect(cop.offenses).to be_empty diff --git a/spec/rubocop/cop/migration/update_large_table_spec.rb b/spec/rubocop/cop/migration/update_large_table_spec.rb index 0463b6550a8..bdb0ca3466b 100644 --- a/spec/rubocop/cop/migration/update_large_table_spec.rb +++ b/spec/rubocop/cop/migration/update_large_table_spec.rb @@ -18,7 +18,7 @@ describe RuboCop::Cop::Migration::UpdateLargeTable do end shared_examples 'large tables' do |update_method| - described_class::LARGE_TABLES.each do |table| + described_class::BLACKLISTED_TABLES.each do |table| it "registers an offense for the #{table} table" do inspect_source("#{update_method} :#{table}, :column, default: true") @@ -53,7 +53,7 @@ describe RuboCop::Cop::Migration::UpdateLargeTable do end it 'registers no offense for non-blacklisted methods' do - table = described_class::LARGE_TABLES.sample + table = described_class::BLACKLISTED_TABLES.sample inspect_source("some_other_method :#{table}, :column, default: true") @@ -62,7 +62,7 @@ describe RuboCop::Cop::Migration::UpdateLargeTable do end context 'outside of migration' do - let(:table) { described_class::LARGE_TABLES.sample } + let(:table) { described_class::BLACKLISTED_TABLES.sample } it 'registers no offense for add_column_with_default' do inspect_source("add_column_with_default :#{table}, :column, default: true") |