diff options
Diffstat (limited to 'spec/migrations/finalize_project_namespaces_backfill_spec.rb')
-rw-r--r-- | spec/migrations/finalize_project_namespaces_backfill_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/migrations/finalize_project_namespaces_backfill_spec.rb b/spec/migrations/finalize_project_namespaces_backfill_spec.rb index 3d0b0ec13fe..56f3b0f6ba5 100644 --- a/spec/migrations/finalize_project_namespaces_backfill_spec.rb +++ b/spec/migrations/finalize_project_namespaces_backfill_spec.rb @@ -9,9 +9,11 @@ RSpec.describe FinalizeProjectNamespacesBackfill, :migration do let_it_be(:migration) { described_class::MIGRATION } describe '#up' do - shared_examples 'raises migration not finished exception' do - it 'raises exception' do - expect { migrate! }.to raise_error(/Expected batched background migration for the given configuration to be marked as 'finished'/) + 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('"ProjectNamespaces::BackfillProjectNamespaces"', :projects, :id, [nil, "up"]) + end end end @@ -42,7 +44,7 @@ RSpec.describe FinalizeProjectNamespacesBackfill, :migration do context 'when project namespace backfilling migration finished successfully' do it 'does not raise exception' do - expect { migrate! }.not_to raise_error(/Expected batched background migration for the given configuration to be marked as 'finished'/) + expect { migrate! }.not_to raise_error end end @@ -61,7 +63,7 @@ RSpec.describe FinalizeProjectNamespacesBackfill, :migration do project_namespace_backfill.update!(status: status) end - it_behaves_like 'raises migration not finished exception' + it_behaves_like 'finalizes the migration' end end end |