diff options
Diffstat (limited to 'spec/workers/repository_cleanup_worker_spec.rb')
-rw-r--r-- | spec/workers/repository_cleanup_worker_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/workers/repository_cleanup_worker_spec.rb b/spec/workers/repository_cleanup_worker_spec.rb index f5887d08bd2..2b700b944d2 100644 --- a/spec/workers/repository_cleanup_worker_spec.rb +++ b/spec/workers/repository_cleanup_worker_spec.rb @@ -40,6 +40,8 @@ RSpec.describe RepositoryCleanupWorker do describe '#sidekiq_retries_exhausted' do let(:job) { { 'args' => [project.id, user.id], 'error_message' => 'Error' } } + subject(:sidekiq_retries_exhausted) { described_class.sidekiq_retries_exhausted_block.call(job, StandardError.new) } + it 'does not send a failure notification for a RecordNotFound error' do expect(NotificationService).not_to receive(:new) @@ -51,7 +53,13 @@ RSpec.describe RepositoryCleanupWorker do expect(service).to receive(:repository_cleanup_failure).with(project, user, 'Error') end - described_class.sidekiq_retries_exhausted_block.call(job, StandardError.new) + sidekiq_retries_exhausted + end + + it 'cleans up the attempt' do + expect(Projects::CleanupService).to receive(:cleanup_after).with(project) + + sidekiq_retries_exhausted end end end |