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/finalize_orphaned_routes_cleanup_spec.rb')
-rw-r--r--spec/migrations/finalize_orphaned_routes_cleanup_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb b/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb
index 78546806039..215fdbb05ad 100644
--- a/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb
+++ b/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb
@@ -12,12 +12,16 @@ RSpec.describe FinalizeOrphanedRoutesCleanup, :migration, feature_category: :pro
shared_examples 'finalizes the migration' do
it 'finalizes the migration' do
allow_next_instance_of(Gitlab::Database::BackgroundMigration::BatchedMigrationRunner) do |runner|
- expect(runner).to receive(:finalize).with('CleanupOrphanedRoutes', :projects, :id, [])
+ expect(runner).to receive(:finalize).with(migration, :projects, :id, [])
end
end
end
context 'when migration is missing' do
+ before do
+ batched_migrations.where(job_class_name: migration).delete_all
+ end
+
it 'warns migration not found' do
expect(Gitlab::AppLogger)
.to receive(:warn).with(/Could not find batched background migration for the given configuration:/)
@@ -29,7 +33,7 @@ RSpec.describe FinalizeOrphanedRoutesCleanup, :migration, feature_category: :pro
context 'with migration present' do
let!(:project_namespace_backfill) do
batched_migrations.create!(
- job_class_name: 'CleanupOrphanedRoutes',
+ job_class_name: migration,
table_name: :routes,
column_name: :id,
job_arguments: [],