diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-14 09:09:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-14 09:09:23 +0300 |
commit | a5266bda12fe65e9f10216a36ce492b93c2ad2d8 (patch) | |
tree | 1c1ea68efc56b3333b2062bd772dbe210db63f56 /spec/controllers | |
parent | d57e092bd6497d6e66dacce2374db9d154dd8b24 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 0da8a30611c..438fc2f2106 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -1876,8 +1876,7 @@ RSpec.describe Projects::MergeRequestsController do let(:sha) { forked.commit.sha } let(:environment) { create(:environment, project: forked) } let(:pipeline) { create(:ci_pipeline, sha: sha, project: forked) } - let(:build) { create(:ci_build, pipeline: pipeline) } - let!(:deployment) { create(:deployment, :succeed, environment: environment, sha: sha, ref: 'master', deployable: build) } + let!(:build) { create(:ci_build, :with_deployment, environment: environment.name, pipeline: pipeline) } let(:merge_request) do create(:merge_request, source_project: forked, target_project: project, target_branch: 'master', head_pipeline: pipeline) @@ -1901,8 +1900,7 @@ RSpec.describe Projects::MergeRequestsController do let(:source_environment) { create(:environment, project: project) } let(:merge_commit_sha) { project.repository.merge(user, forked.commit.id, merge_request, "merged in test") } let(:post_merge_pipeline) { create(:ci_pipeline, sha: merge_commit_sha, project: project) } - let(:post_merge_build) { create(:ci_build, pipeline: post_merge_pipeline) } - let!(:source_deployment) { create(:deployment, :succeed, environment: source_environment, sha: merge_commit_sha, ref: 'master', deployable: post_merge_build) } + let!(:post_merge_build) { create(:ci_build, :with_deployment, environment: source_environment.name, pipeline: post_merge_pipeline) } before do merge_request.update!(merge_commit_sha: merge_commit_sha) @@ -1944,9 +1942,6 @@ RSpec.describe Projects::MergeRequestsController do context 'when a merge request has multiple environments with deployments' do let(:sha) { merge_request.diff_head_sha } - let(:ref) { merge_request.source_branch } - - let!(:build) { create(:ci_build, pipeline: pipeline) } let!(:pipeline) { create(:ci_pipeline, sha: sha, project: project) } let!(:environment) { create(:environment, name: 'env_a', project: project) } let!(:another_environment) { create(:environment, name: 'env_b', project: project) } @@ -1954,8 +1949,8 @@ RSpec.describe Projects::MergeRequestsController do before do merge_request.update_head_pipeline - create(:deployment, :succeed, environment: environment, sha: sha, ref: ref, deployable: build) - create(:deployment, :succeed, environment: another_environment, sha: sha, ref: ref, deployable: build) + create(:ci_build, :with_deployment, environment: environment.name, pipeline: pipeline) + create(:ci_build, :with_deployment, environment: another_environment.name, pipeline: pipeline) end it 'exposes multiple environment statuses' do |