diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 18:09:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 18:09:22 +0000 |
commit | 62baa95f25f1cc56b100d2b64b0a3906f47dcfe1 (patch) | |
tree | 0bee30bc13c3cb7444f1d89d2647719718a31d76 /spec/workers | |
parent | ff8eb438401fc82b883fc4ae69626f0035b69236 (diff) | |
download | gitlab-ce-62baa95f25f1cc56b100d2b64b0a3906f47dcfe1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-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 |