Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/presenters/blob_presenter_spec.rb')
-rw-r--r--spec/presenters/blob_presenter_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/presenters/blob_presenter_spec.rb b/spec/presenters/blob_presenter_spec.rb
index 150c7bd5f3e..a249597e900 100644
--- a/spec/presenters/blob_presenter_spec.rb
+++ b/spec/presenters/blob_presenter_spec.rb
@@ -130,7 +130,7 @@ RSpec.describe BlobPresenter do
describe '#pipeline_editor_path' do
context 'when blob is .gitlab-ci.yml' do
- before do
+ before_all do
project.repository.create_file(
user,
'.gitlab-ci.yml',
@@ -144,6 +144,16 @@ RSpec.describe BlobPresenter do
let(:path) { '.gitlab-ci.yml' }
it { expect(presenter.pipeline_editor_path).to eq("/#{project.full_path}/-/ci/editor?branch_name=#{ref}") }
+
+ context 'when ref includes the qualifier' do
+ let(:ref) { 'refs/heads/main' }
+
+ it 'returns path to unqualified ref' do
+ allow(blob).to receive(:ref_type).and_return('heads')
+
+ expect(presenter.pipeline_editor_path).to eq("/#{project.full_path}/-/ci/editor?branch_name=main")
+ end
+ end
end
end