Merge branch '3064-group-burndown-chart' into 'master'
[Backport] EE's Burndown chart for group milestone common code See merge request gitlab-org/gitlab-ce!18511
This commit is contained in:
commit
a544f6ec58
2 changed files with 23 additions and 0 deletions
|
@ -81,6 +81,14 @@ module GitlabRoutingHelper
|
|||
end
|
||||
end
|
||||
|
||||
def edit_milestone_path(entity, *args)
|
||||
if entity.parent.is_a?(Group)
|
||||
edit_group_milestone_path(entity.parent, entity, *args)
|
||||
else
|
||||
edit_project_milestone_path(entity.parent, entity, *args)
|
||||
end
|
||||
end
|
||||
|
||||
def toggle_subscription_path(entity, *args)
|
||||
if entity.is_a?(Issue)
|
||||
toggle_subscription_project_issue_path(entity.project, entity)
|
||||
|
|
|
@ -89,4 +89,19 @@ describe GitlabRoutingHelper do
|
|||
expect(preview_markdown_path(project)).to eq("/#{project.full_path}/preview_markdown")
|
||||
end
|
||||
end
|
||||
|
||||
describe '#edit_milestone_path' do
|
||||
it 'returns group milestone edit path when given entity parent is a Group' do
|
||||
group = create(:group)
|
||||
milestone = create(:milestone, group: group)
|
||||
|
||||
expect(edit_milestone_path(milestone)).to eq("/groups/#{group.path}/-/milestones/#{milestone.iid}/edit")
|
||||
end
|
||||
|
||||
it 'returns project milestone edit path when given entity parent is not a Group' do
|
||||
milestone = create(:milestone, group: nil)
|
||||
|
||||
expect(edit_milestone_path(milestone)).to eq("/#{milestone.project.full_path}/milestones/#{milestone.iid}/edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue