BigW Consortium Gitlab

Commit 1f3225a5 by Douwe Maan

Merge branch 'mk-fix-breadcrumb-order-33938' into 'master'

Fix breadcrumb order Closes #33938 See merge request !12322
parents 788f5415 466adeeb
......@@ -15,7 +15,7 @@ module GroupsHelper
@has_group_title = true
full_title = ''
group.ancestors.each do |parent|
group.ancestors.reverse.each do |parent|
full_title += link_to(simple_sanitize(parent.name), group_path(parent), class: 'group-path hidable')
full_title += '<span class="hidable"> / </span>'.html_safe
end
......
---
title: Fix reversed breadcrumb order for nested groups
merge_request: 12322
author:
require 'spec_helper'
describe GroupsHelper do
include ApplicationHelper
describe 'group_icon' do
avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
......@@ -81,4 +83,15 @@ describe GroupsHelper do
end
end
end
describe 'group_title' do
let(:group) { create(:group) }
let(:nested_group) { create(:group, parent: group) }
let(:deep_nested_group) { create(:group, parent: nested_group) }
let!(:very_deep_nested_group) { create(:group, parent: deep_nested_group) }
it 'outputs the groups in the correct order' do
expect(group_title(very_deep_nested_group)).to match(/>#{group.name}<\/a>.*>#{nested_group.name}<\/a>.*>#{deep_nested_group.name}<\/a>/)
end
end
end
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