diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/workers/process_commit_worker_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/workers/process_commit_worker_spec.rb')
-rw-r--r-- | spec/workers/process_commit_worker_spec.rb | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/spec/workers/process_commit_worker_spec.rb b/spec/workers/process_commit_worker_spec.rb index 21c300af7ac..d247668ac76 100644 --- a/spec/workers/process_commit_worker_spec.rb +++ b/spec/workers/process_commit_worker_spec.rb @@ -22,16 +22,26 @@ describe ProcessCommitWorker do worker.perform(project.id, -1, commit.to_hash) end - it 'processes the commit message' do - expect(worker).to receive(:process_commit_message).and_call_original + include_examples 'an idempotent worker' do + subject do + perform_multiple([project.id, user.id, commit.to_hash], worker: worker) + end - worker.perform(project.id, user.id, commit.to_hash) - end + it 'processes the commit message' do + expect(worker).to receive(:process_commit_message) + .exactly(IdempotentWorkerHelper::WORKER_EXEC_TIMES) + .and_call_original - it 'updates the issue metrics' do - expect(worker).to receive(:update_issue_metrics).and_call_original + subject + end - worker.perform(project.id, user.id, commit.to_hash) + it 'updates the issue metrics' do + expect(worker).to receive(:update_issue_metrics) + .exactly(IdempotentWorkerHelper::WORKER_EXEC_TIMES) + .and_call_original + + subject + end end end |