diff options
3 files changed, 25 insertions, 1 deletions
diff --git a/app/views/projects/merge_requests/creations/new.html.haml b/app/views/projects/merge_requests/creations/new.html.haml index 3220512d60d..0f618826305 100644 --- a/app/views/projects/merge_requests/creations/new.html.haml +++ b/app/views/projects/merge_requests/creations/new.html.haml @@ -1,4 +1,5 @@ -- breadcrumb_title "Merge Requests" +- add_to_breadcrumbs "Merge Requests", project_merge_requests_path(@project) +- breadcrumb_title "New" - page_title "New Merge Request" - if @merge_request.can_be_created && !params[:change_branches] diff --git a/changelogs/unreleased/50452-breadcrumb-link-to-new-merge-requests.yml b/changelogs/unreleased/50452-breadcrumb-link-to-new-merge-requests.yml new file mode 100644 index 00000000000..4738f7652a4 --- /dev/null +++ b/changelogs/unreleased/50452-breadcrumb-link-to-new-merge-requests.yml @@ -0,0 +1,5 @@ +--- +title: "Fix breadcrumb link to merge requests on new merge request page" +merge_request: 21502 +author: J.D. Bean +type: fixed diff --git a/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb b/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb new file mode 100644 index 00000000000..3c2e0f4892c --- /dev/null +++ b/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' + +describe 'New merge request breadcrumbs' do + let(:project) { create(:project) } + let(:user) { project.creator } + + before do + sign_in(user) + visit project_new_merge_request_path(project) + end + + it 'display a link to project merge requests and new merge request pages' do + page.within '.breadcrumbs' do + expect(find_link('Merge Requests')[:href]).to end_with(project_merge_requests_path(project)) + expect(find_link('New')[:href]).to end_with(project_new_merge_request_path(project)) + end + end +end |