diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-06 12:09:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-06 12:09:36 +0000 |
commit | 4279f24a19836d3e74e4aae8bea7acc2dd8222cc (patch) | |
tree | 76e4b3cf4d6bd85ff50e40bf011e7f9bc350441a /spec/presenters/ci/build_runner_presenter_spec.rb | |
parent | 51c20446a0dcf2f5f4a0254230876bd472a254e7 (diff) | |
download | gitlab-ce-4279f24a19836d3e74e4aae8bea7acc2dd8222cc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters/ci/build_runner_presenter_spec.rb')
-rw-r--r-- | spec/presenters/ci/build_runner_presenter_spec.rb | 81 |
1 files changed, 17 insertions, 64 deletions
diff --git a/spec/presenters/ci/build_runner_presenter_spec.rb b/spec/presenters/ci/build_runner_presenter_spec.rb index 28806a1c7e3..6b2b031dbd0 100644 --- a/spec/presenters/ci/build_runner_presenter_spec.rb +++ b/spec/presenters/ci/build_runner_presenter_spec.rb @@ -173,81 +173,34 @@ describe Ci::BuildRunnerPresenter do let(:pipeline) { merge_request.all_pipelines.first } let(:build) { create(:ci_build, ref: pipeline.ref, pipeline: pipeline) } - context 'when depend_on_persistent_pipeline_ref feature flag is enabled' do - before do - stub_feature_flags(ci_force_exposing_merge_request_refs: false) - pipeline.persistent_ref.create - end - - it 'returns the correct refspecs' do - is_expected - .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") - end - - context 'when ci_force_exposing_merge_request_refs feature flag is enabled' do - before do - stub_feature_flags(ci_force_exposing_merge_request_refs: true) - end - - it 'returns the correct refspecs' do - is_expected - .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", - '+refs/merge-requests/1/head:refs/merge-requests/1/head') - end - end - - context 'when GIT_DEPTH is zero' do - before do - create(:ci_pipeline_variable, key: 'GIT_DEPTH', value: 0, pipeline: build.pipeline) - end - - it 'returns the correct refspecs' do - is_expected - .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", - '+refs/heads/*:refs/remotes/origin/*', - '+refs/tags/*:refs/tags/*') - end - end - - context 'when pipeline is legacy detached merge request pipeline' do - let(:merge_request) { create(:merge_request, :with_legacy_detached_merge_request_pipeline) } + before do + pipeline.persistent_ref.create + end - it 'returns the correct refspecs' do - is_expected.to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", - "+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}") - end - end + it 'returns the correct refspecs' do + is_expected + .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") end - context 'when depend_on_persistent_pipeline_ref feature flag is disabled' do + context 'when GIT_DEPTH is zero' do before do - stub_feature_flags(depend_on_persistent_pipeline_ref: false) + create(:ci_pipeline_variable, key: 'GIT_DEPTH', value: 0, pipeline: build.pipeline) end it 'returns the correct refspecs' do is_expected - .to contain_exactly('+refs/merge-requests/1/head:refs/merge-requests/1/head') - end - - context 'when GIT_DEPTH is zero' do - before do - create(:ci_pipeline_variable, key: 'GIT_DEPTH', value: 0, pipeline: build.pipeline) - end - - it 'returns the correct refspecs' do - is_expected - .to contain_exactly('+refs/merge-requests/1/head:refs/merge-requests/1/head', - '+refs/heads/*:refs/remotes/origin/*', - '+refs/tags/*:refs/tags/*') - end + .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", + '+refs/heads/*:refs/remotes/origin/*', + '+refs/tags/*:refs/tags/*') end + end - context 'when pipeline is legacy detached merge request pipeline' do - let(:merge_request) { create(:merge_request, :with_legacy_detached_merge_request_pipeline) } + context 'when pipeline is legacy detached merge request pipeline' do + let(:merge_request) { create(:merge_request, :with_legacy_detached_merge_request_pipeline) } - it 'returns the correct refspecs' do - is_expected.to contain_exactly("+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}") - end + it 'returns the correct refspecs' do + is_expected.to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", + "+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}") end end end |