diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-28 00:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-28 00:10:10 +0300 |
commit | 579e85eb029c4ee66e8b8cd537a94b9e6cb0e58b (patch) | |
tree | 26c28e966b7f2e4fabf06bfaa1d650ac4579f9e4 /spec/workers | |
parent | f569792df8a25caa1bed9c448c8c4c3f837f5164 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-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 |