Commit b6144b98 authored by Robert Speicher's avatar Robert Speicher

Merge branch '9106-epic_entity_date_fix' into 'master'

Fix EpicBaseEntity human_readable_timestamp

Closes #9106

See merge request gitlab-org/gitlab-ee!9077
parents 2b261c47 bcdd4b7b
...@@ -13,6 +13,6 @@ class EpicBaseEntity < Grape::Entity ...@@ -13,6 +13,6 @@ class EpicBaseEntity < Grape::Entity
epic.end_date&.to_s(:medium) epic.end_date&.to_s(:medium)
end end
expose :human_readable_timestamp, if: -> (epic, _) { epic.end_date.present? || epic.start_date.present? } do |epic| expose :human_readable_timestamp, if: -> (epic, _) { epic.end_date.present? || epic.start_date.present? } do |epic|
remaining_days_in_words(epic) remaining_days_in_words(epic.end_date, epic.start_date)
end end
end end
...@@ -10,7 +10,8 @@ describe IssueSerializer do ...@@ -10,7 +10,8 @@ describe IssueSerializer do
end end
before do before do
create(:epic_issue, issue: resource) epic = create(:epic, :use_fixed_dates)
create(:epic_issue, issue: resource, epic: epic)
end end
context 'sidebar issue serialization' do context 'sidebar issue serialization' do
......
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