BigW Consortium Gitlab

Commit 0addef2e by Tim Zallmann

Merge branch 'breadcrumb-item-links' into 'master'

Fixed breadcrumb title not linking Closes #38059 See merge request gitlab-org/gitlab-ce!14532
parents a481337b d0737b18
......@@ -10,11 +10,7 @@ module BreadcrumbsHelper
def breadcrumb_title_link
return @breadcrumb_link if @breadcrumb_link
if controller.available_action?(:index)
url_for(action: "index")
else
request.path
end
request.path
end
def breadcrumb_title(title)
......
......@@ -16,5 +16,5 @@
= breadcrumb_list_item link_to(extra[:text], extra[:link])
= render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after
%li
%h2.breadcrumbs-sub-title= @breadcrumb_title
%h2.breadcrumbs-sub-title= link_to @breadcrumb_title, breadcrumb_title_link
= yield :header_content
---
title: Fixed issue/merge request breadcrumb titles not having links
merge_request:
author:
type: fixed
......@@ -131,6 +131,14 @@ describe 'Issues' do
end
describe 'Issue info' do
it 'links to current issue in breadcrubs' do
issue = create(:issue, project: project)
visit project_issue_path(project, issue)
expect(find('.breadcrumbs-sub-title a')[:href]).to end_with(issue_path(issue))
end
it 'excludes award_emoji from comment count' do
issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
create(:award_emoji, awardable: issue)
......
......@@ -40,7 +40,7 @@ describe 'User updates wiki page' do
expect(current_path).to include('one/two/three-test')
expect(find('.wiki-pages')).to have_content('Three')
click_on('Three')
first(:link, text: 'Three').click
expect(find('.nav-text')).to have_content('Three')
......
......@@ -34,7 +34,7 @@ describe 'User views a wiki page' do
it 'shows the history of a page that has a path', :js do
expect(current_path).to include('one/two/three-test')
click_on('Three')
first(:link, text: 'Three').click
click_on('Page history')
expect(current_path).to include('one/two/three-test')
......@@ -48,7 +48,7 @@ describe 'User views a wiki page' do
expect(current_path).to include('one/two/three-test')
expect(find('.wiki-pages')).to have_content('Three')
click_on('Three')
first(:link, text: 'Three').click
expect(find('.nav-text')).to have_content('Three')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment