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/migrations/schedule_migrate_shared_vulnerability_identifiers_spec.rb')
-rw-r--r--spec/migrations/schedule_migrate_shared_vulnerability_identifiers_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/migrations/schedule_migrate_shared_vulnerability_identifiers_spec.rb b/spec/migrations/schedule_migrate_shared_vulnerability_identifiers_spec.rb
new file mode 100644
index 00000000000..c1802a1a339
--- /dev/null
+++ b/spec/migrations/schedule_migrate_shared_vulnerability_identifiers_spec.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require_migration!
+
+RSpec.describe ScheduleMigrateSharedVulnerabilityIdentifiers, :migration, feature_category: :vulnerability_management do
+ describe "#up" do
+ before do
+ migrate!
+ end
+
+ it "schedules" do
+ Gitlab::Database::BackgroundMigration::BatchedMigration.find_by!(
+ job_class_name: described_class::MIGRATION,
+ table_name: described_class::TABLE_NAME,
+ column_name: described_class::BATCH_COLUMN,
+ batch_size: described_class::BATCH_SIZE,
+ sub_batch_size: described_class::SUB_BATCH_SIZE)
+ end
+ end
+
+ describe '#down' do
+ before do
+ schema_migrate_down!
+ end
+
+ it "deletes" do
+ expect(described_class::MIGRATION).not_to have_scheduled_batched_migration
+ end
+ end
+end