diff options
Diffstat (limited to 'spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb')
-rw-r--r-- | spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb b/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb index b6bd825ffcd..f8e950d8917 100644 --- a/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb +++ b/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb @@ -38,7 +38,7 @@ RSpec.describe Database::CiProjectMirrorsConsistencyCheckWorker do before do redis_shared_state_cleanup! stub_feature_flags(ci_project_mirrors_consistency_check: true) - create_list(:project, 10) # This will also create Ci::NameSpaceMirror objects + create_list(:project, 10) # This will also create Ci::ProjectMirror objects missing_project.delete allow_next_instance_of(Database::ConsistencyCheckService) do |instance| @@ -62,6 +62,15 @@ RSpec.describe Database::CiProjectMirrorsConsistencyCheckWorker do expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result) worker.perform end + + it 'calls the consistency_fix_service to fix the inconsistencies' do + expect_next_instance_of(Database::ConsistencyFixService) do |instance| + expect(instance).to receive(:execute).with( + ids: [missing_project.id] + ).and_call_original + end + worker.perform + end end end end |