diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index c3b9246f19c1eb04cf5ce164d9448d78a05ecc79..6ff17d824af0d38dda4bbf7f49ec6b29cfea9469 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -24,7 +24,7 @@ - @pipeline.yaml_errors.split("\n").each do |error| %li= error - if can_view_pipeline_editor?(@project) - = render Pajamas::ButtonComponent.new(href: project_ci_pipeline_editor_path(@project), variant: :confirm) do + = render Pajamas::ButtonComponent.new(href: project_ci_pipeline_editor_path(@project, branch_name: @pipeline.source_ref), variant: :confirm) do = s_("Pipelines|Go to the pipeline editor") - else diff --git a/spec/views/projects/pipelines/show.html.haml_spec.rb b/spec/views/projects/pipelines/show.html.haml_spec.rb index 81a11874886d0ce06a9e2e8d6e53e58d1a180851..65659129918a63fa6dcbd28a8aa23a39754aa663 100644 --- a/spec/views/projects/pipelines/show.html.haml_spec.rb +++ b/spec/views/projects/pipelines/show.html.haml_spec.rb @@ -40,14 +40,14 @@ render expect(rendered).to have_link s_('Go to the pipeline editor'), - href: project_ci_pipeline_editor_path(project) + href: project_ci_pipeline_editor_path(project, branch_name: pipeline.source_ref) end it 'renders the pipeline editor button with correct link for users who can not view' do render expect(rendered).not_to have_link s_('Go to the pipeline editor'), - href: project_ci_pipeline_editor_path(project) + href: project_ci_pipeline_editor_path(project, branch_name: pipeline.source_ref) end end