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/migration/add_reference_spec.rb')
-rw-r--r--spec/rubocop/cop/migration/add_reference_spec.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/rubocop/cop/migration/add_reference_spec.rb b/spec/rubocop/cop/migration/add_reference_spec.rb
index 6e229d3eefc..35386f14e26 100644
--- a/spec/rubocop/cop/migration/add_reference_spec.rb
+++ b/spec/rubocop/cop/migration/add_reference_spec.rb
@@ -5,11 +5,9 @@ require 'rubocop'
require_relative '../../../../rubocop/cop/migration/add_reference'
RSpec.describe RuboCop::Cop::Migration::AddReference do
- include CopHelper
-
let(:cop) { described_class.new }
- context 'outside of a migration' do
+ context 'when outside of a migration' do
it 'does not register any offenses' do
expect_no_offenses(<<~RUBY)
def up
@@ -19,12 +17,12 @@ RSpec.describe RuboCop::Cop::Migration::AddReference do
end
end
- context 'in a migration' do
+ context 'when in a migration' do
before do
allow(cop).to receive(:in_migration?).and_return(true)
end
- let(:offense) { '`add_reference` requires downtime for existing tables, use `add_concurrent_foreign_key` instead. When used for new tables, `index: true` or `index: { options... } is required.`' }
+ let(:offense) { '`add_reference` requires downtime for existing tables, use `add_concurrent_foreign_key`[...]' }
context 'when the table existed before' do
it 'registers an offense when using add_reference' do