Commit 2d51f7b9 authored by Brett Walker's avatar Brett Walker

Fix calculation of epic ancestor links

parent 3913731f
......@@ -133,7 +133,7 @@ class EpicPresenter < Gitlab::View::Presenter::Delegated
{
id: epic.id,
title: epic.title,
url: group_epic_path,
url: url_builder.epic_path(epic),
state: epic.state,
human_readable_end_date: epic.end_date&.to_s(:medium),
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
expect(presenter.show_data.keys).to match_array([:initial, :meta])
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
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