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_concurrent_foreign_key_spec.rb')
-rw-r--r--spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb b/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb
index 419d74c298a..dfc3898af24 100644
--- a/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb
+++ b/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb
@@ -33,5 +33,11 @@ describe RuboCop::Cop::Migration::AddConcurrentForeignKey do
expect(cop.offenses.map(&:line)).to eq([1])
end
end
+
+ it 'does not register an offense when a `NOT VALID` foreign key is added' do
+ inspect_source('def up; add_foreign_key(:projects, :users, column: :user_id, validate: false); end')
+
+ expect(cop.offenses).to be_empty
+ end
end
end