diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 21:07:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 21:07:40 +0300 |
commit | 5e7ed643dca39625fcc7b0d0e9e15550f5a9f1f8 (patch) | |
tree | 6a1d9d1fc3825e7fcaf4d688f96bc97954eaa904 /spec/workers | |
parent | 511e761b41b81484c85e3d125f45873ce38e9201 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/deployments/finished_worker_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/workers/deployments/finished_worker_spec.rb b/spec/workers/deployments/finished_worker_spec.rb index df62821e2cd..f0e3439fdfa 100644 --- a/spec/workers/deployments/finished_worker_spec.rb +++ b/spec/workers/deployments/finished_worker_spec.rb @@ -10,6 +10,20 @@ describe Deployments::FinishedWorker do allow(ProjectServiceWorker).to receive(:perform_async) end + it 'links merge requests to the deployment' do + deployment = create(:deployment) + service = instance_double(Deployments::LinkMergeRequestsService) + + expect(Deployments::LinkMergeRequestsService) + .to receive(:new) + .with(deployment) + .and_return(service) + + expect(service).to receive(:execute) + + worker.perform(deployment.id) + end + it 'executes project services for deployment_hooks' do deployment = create(:deployment) project = deployment.project @@ -35,5 +49,17 @@ describe Deployments::FinishedWorker do expect(ProjectServiceWorker).not_to have_received(:perform_async) end + + context 'when the tracking of merge requests is disabled' do + it 'does not track the deployed merge requests' do + stub_feature_flags(deployment_merge_requests: false) + + deployment = create(:deployment) + + expect(Deployments::LinkMergeRequestsService).not_to receive(:new) + + worker.perform(deployment.id) + end + end end end |