Commit 5007dbd2 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fix-subgroup-milestone-links' into 'master'

Subgroup links should use the subgroup full path

Closes #205375 and #208279

See merge request gitlab-org/gitlab!31383
parents 4f477993 ca4d67f2
......@@ -249,7 +249,7 @@ module MilestonesHelper
if milestone.legacy_group_milestone?
group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: params)
else
group_milestone_path(@group, milestone.iid, milestone: params)
group_milestone_path(milestone.group, milestone.iid, milestone: params)
end
end
......
---
title: Link to subgroup milestones correctly from group milestones page
merge_request: 31383
author:
type: fixed
......@@ -85,4 +85,19 @@ describe MilestonesHelper do
end
end
end
describe "#group_milestone_route" do
let(:group) { build_stubbed(:group) }
let(:subgroup) { build_stubbed(:group, parent: group, name: "Test Subgrp") }
context "when in subgroup" do
let(:milestone) { build_stubbed(:group_milestone, group: subgroup) }
it 'generates correct url despite assigned @group' do
assign(:group, group)
milestone_path = "/groups/#{subgroup.full_path}/-/milestones/#{milestone.iid}"
expect(helper.group_milestone_route(milestone)).to eq(milestone_path)
end
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