diff options
Diffstat (limited to 'spec/presenters/ci/build_runner_presenter_spec.rb')
-rw-r--r-- | spec/presenters/ci/build_runner_presenter_spec.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/spec/presenters/ci/build_runner_presenter_spec.rb b/spec/presenters/ci/build_runner_presenter_spec.rb index b8d0b093a24..d25102532a7 100644 --- a/spec/presenters/ci/build_runner_presenter_spec.rb +++ b/spec/presenters/ci/build_runner_presenter_spec.rb @@ -173,11 +173,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected.to contain_exactly("+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}", - "+#{pipeline.sha}:refs/pipelines/#{pipeline.id}") - end - - it 'uses a SHA in the persistent refspec' do - expect(subject[0]).to match(%r{^\+[0-9a-f]{40}:refs/pipelines/[0-9]+$}) + "+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") end context 'when ref is tag' do @@ -185,7 +181,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected.to contain_exactly("+refs/tags/#{build.ref}:refs/tags/#{build.ref}", - "+#{pipeline.sha}:refs/pipelines/#{pipeline.id}") + "+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") end context 'when GIT_DEPTH is zero' do @@ -196,7 +192,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected.to contain_exactly('+refs/tags/*:refs/tags/*', '+refs/heads/*:refs/remotes/origin/*', - "+#{pipeline.sha}:refs/pipelines/#{pipeline.id}") + "+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") end end end @@ -212,7 +208,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected - .to contain_exactly("+#{pipeline.sha}:refs/pipelines/#{pipeline.id}") + .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}") end context 'when GIT_DEPTH is zero' do @@ -222,7 +218,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected - .to contain_exactly("+#{pipeline.sha}:refs/pipelines/#{pipeline.id}", + .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", '+refs/heads/*:refs/remotes/origin/*', '+refs/tags/*:refs/tags/*') end @@ -232,7 +228,7 @@ RSpec.describe Ci::BuildRunnerPresenter do let(:merge_request) { create(:merge_request, :with_legacy_detached_merge_request_pipeline) } it 'returns the correct refspecs' do - is_expected.to contain_exactly("+#{pipeline.sha}:refs/pipelines/#{pipeline.id}", + is_expected.to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", "+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}") end end @@ -250,7 +246,7 @@ RSpec.describe Ci::BuildRunnerPresenter do it 'exposes the persistent pipeline ref' do is_expected - .to contain_exactly("+#{pipeline.sha}:refs/pipelines/#{pipeline.id}", + .to contain_exactly("+refs/pipelines/#{pipeline.id}:refs/pipelines/#{pipeline.id}", "+refs/heads/#{build.ref}:refs/remotes/origin/#{build.ref}") end end |