Skip to content
代码片段 群组 项目
提交 cfe3658a 编辑于 作者: Aaron Dewes's avatar Aaron Dewes 提交者: Jerry Seto
浏览文件

Only include branch name pipeline editor link

Changelog: fixed
上级 72291b9e
No related branches found
No related tags found
无相关合并请求
...@@ -77,7 +77,7 @@ def replace_path ...@@ -77,7 +77,7 @@ def replace_path
end end
def pipeline_editor_path def pipeline_editor_path
project_ci_pipeline_editor_path(project, branch_name: blob.commit_id) if can_collaborate_with_project?(project) && blob.path == project.ci_config_path_or_default project_ci_pipeline_editor_path(project, branch_name: commit_id) if can_collaborate_with_project?(project) && blob.path == project.ci_config_path_or_default
end end
def gitpod_blob_url def gitpod_blob_url
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
describe '#pipeline_editor_path' do describe '#pipeline_editor_path' do
context 'when blob is .gitlab-ci.yml' do context 'when blob is .gitlab-ci.yml' do
before do before_all do
project.repository.create_file( project.repository.create_file(
user, user,
'.gitlab-ci.yml', '.gitlab-ci.yml',
...@@ -144,6 +144,16 @@ ...@@ -144,6 +144,16 @@
let(:path) { '.gitlab-ci.yml' } let(:path) { '.gitlab-ci.yml' }
it { expect(presenter.pipeline_editor_path).to eq("/#{project.full_path}/-/ci/editor?branch_name=#{ref}") } 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
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册