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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-07 00:07:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-07 00:07:43 +0300
commit015663b70f1bcdae4483e38c2beac884f92da5b8 (patch)
tree6dd5a59c7f9a27c3cca22801ca30bf3dd8f9b401 /spec/lib/gitlab/database
parent5eb11b697d7ee280b0b5c2ff9a1850a3b5e9b7e3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/database')
-rw-r--r--spec/lib/gitlab/database/migration_helpers_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb
index cac6908f4b4..9c8d53b0ed7 100644
--- a/spec/lib/gitlab/database/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/migration_helpers_spec.rb
@@ -325,6 +325,25 @@ describe Gitlab::Database::MigrationHelpers do
end
end
end
+
+ describe 'validate option' do
+ let(:args) { [:projects, :users] }
+ let(:options) { { column: :user_id, on_delete: nil } }
+
+ context 'when validate is supplied with a falsey value' do
+ it_behaves_like 'skips validation', validate: false
+ it_behaves_like 'skips validation', validate: nil
+ end
+
+ context 'when validate is supplied with a truthy value' do
+ it_behaves_like 'performs validation', validate: true
+ it_behaves_like 'performs validation', validate: :whatever
+ end
+
+ context 'when validate is not supplied' do
+ it_behaves_like 'performs validation', {}
+ end
+ end
end
end