diff options
Diffstat (limited to 'spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb')
-rw-r--r-- | spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb b/spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb index e6592f7f204..ba6cf133b0c 100644 --- a/spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb +++ b/spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb @@ -82,6 +82,7 @@ RSpec.describe ContainerExpirationPolicies::CleanupContainerRepositoryWorker do it 'skips the repository' do expect(ContainerExpirationPolicies::CleanupService).not_to receive(:new) expect(worker).to receive(:log_extra_metadata_on_done).with(:container_repository_id, repository.id) + expect(worker).to receive(:log_extra_metadata_on_done).with(:project_id, repository.project.id) expect(worker).to receive(:log_extra_metadata_on_done).with(:cleanup_status, :skipped) expect { subject }.to change { ContainerRepository.waiting_for_cleanup.count }.from(1).to(0) @@ -213,8 +214,10 @@ RSpec.describe ContainerExpirationPolicies::CleanupContainerRepositoryWorker do end def expect_log_extra_metadata(service_response:, cleanup_status: :finished, truncated: false) - expect(worker).to receive(:log_extra_metadata_on_done).with(:cleanup_status, cleanup_status) expect(worker).to receive(:log_extra_metadata_on_done).with(:container_repository_id, repository.id) + expect(worker).to receive(:log_extra_metadata_on_done).with(:project_id, repository.project.id) + expect(worker).to receive(:log_extra_metadata_on_done).with(:cleanup_status, cleanup_status) + %i[cleanup_tags_service_original_size cleanup_tags_service_before_truncate_size cleanup_tags_service_after_truncate_size cleanup_tags_service_before_delete_size].each do |field| value = service_response.payload[field] expect(worker).to receive(:log_extra_metadata_on_done).with(field, value) unless value.nil? |