summaryrefslogtreecommitdiff
path: root/spec/services/deployments
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 18:07:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 18:07:40 +0000
commit5e7ed643dca39625fcc7b0d0e9e15550f5a9f1f8 (patch)
tree6a1d9d1fc3825e7fcaf4d688f96bc97954eaa904 /spec/services/deployments
parent511e761b41b81484c85e3d125f45873ce38e9201 (diff)
downloadgitlab-ce-5e7ed643dca39625fcc7b0d0e9e15550f5a9f1f8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/deployments')
-rw-r--r--spec/services/deployments/after_create_service_spec.rb34
-rw-r--r--spec/services/deployments/link_merge_requests_service_spec.rb7
2 files changed, 5 insertions, 36 deletions
diff --git a/spec/services/deployments/after_create_service_spec.rb b/spec/services/deployments/after_create_service_spec.rb
index 14b6dd4a74e..51c6de2c0b9 100644
--- a/spec/services/deployments/after_create_service_spec.rb
+++ b/spec/services/deployments/after_create_service_spec.rb
@@ -61,14 +61,6 @@ describe Deployments::AfterCreateService do
service.execute
end
- it 'links merge requests to deployment' do
- expect_next_instance_of(Deployments::LinkMergeRequestsService, deployment) do |link_mr_service|
- expect(link_mr_service).to receive(:execute)
- end
-
- service.execute
- end
-
it 'returns the deployment' do
expect(subject.execute).to eq(deployment)
end
@@ -272,30 +264,4 @@ describe Deployments::AfterCreateService do
end
end
end
-
- describe '#update_environment' do
- it 'links the merge requests' do
- double = instance_double(Deployments::LinkMergeRequestsService)
-
- allow(Deployments::LinkMergeRequestsService)
- .to receive(:new)
- .with(deployment)
- .and_return(double)
-
- expect(double).to receive(:execute)
-
- service.update_environment(deployment)
- end
-
- context 'when the tracking of merge requests is disabled' do
- it 'does nothing' do
- stub_feature_flags(deployment_merge_requests: false)
-
- expect(Deployments::LinkMergeRequestsService)
- .not_to receive(:new)
-
- service.update_environment(deployment)
- end
- end
- end
end
diff --git a/spec/services/deployments/link_merge_requests_service_spec.rb b/spec/services/deployments/link_merge_requests_service_spec.rb
index a0fb3b0abb0..307fe22a192 100644
--- a/spec/services/deployments/link_merge_requests_service_spec.rb
+++ b/spec/services/deployments/link_merge_requests_service_spec.rb
@@ -6,9 +6,12 @@ describe Deployments::LinkMergeRequestsService do
let(:project) { create(:project, :repository) }
describe '#execute' do
- context 'when the deployment did not succeed' do
+ context 'when the deployment is for a review environment' do
it 'does nothing' do
- deploy = create(:deployment, :failed)
+ environment =
+ create(:environment, environment_type: 'review', name: 'review/foo')
+
+ deploy = create(:deployment, :success, environment: environment)
expect(deploy).not_to receive(:link_merge_requests)