Commit efcd5785 authored by Sean McGivern's avatar Sean McGivern

Merge branch '12101-epic-ancestor-links-link-to-self-vs-ancestor-epic' into 'master'

Fix Calculation of Epic Ancestor Links

See merge request gitlab-org/gitlab-ee!14092
parents 37b9c3a2 2d51f7b9
...@@ -133,7 +133,7 @@ class EpicPresenter < Gitlab::View::Presenter::Delegated ...@@ -133,7 +133,7 @@ class EpicPresenter < Gitlab::View::Presenter::Delegated
{ {
id: epic.id, id: epic.id,
title: epic.title, title: epic.title,
url: group_epic_path, url: url_builder.epic_path(epic),
state: epic.state, state: epic.state,
human_readable_end_date: epic.end_date&.to_s(:medium), human_readable_end_date: epic.end_date&.to_s(:medium),
human_readable_timestamp: remaining_days_in_words(epic.end_date, epic.start_date) human_readable_timestamp: remaining_days_in_words(epic.end_date, epic.start_date)
......
---
title: Fix incorrect epic ancestor links
merge_request: 14092
author:
type: fixed
...@@ -29,6 +29,13 @@ describe EpicPresenter do ...@@ -29,6 +29,13 @@ describe EpicPresenter do
expect(presenter.show_data.keys).to match_array([:initial, :meta]) expect(presenter.show_data.keys).to match_array([:initial, :meta])
end end
it 'has correct ancestors' do
metadata = JSON.parse(presenter.show_data[:meta])
ancestor_url = metadata['ancestors'].first['url']
expect(ancestor_url).to eq "/groups/#{parent_epic.group.full_path}/-/epics/#{parent_epic.iid}"
end
it 'returns the correct json schema for epic initial data' do it 'returns the correct json schema for epic initial data' do
data = presenter.show_data(author_icon: 'icon_path') data = presenter.show_data(author_icon: 'icon_path')
......
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