Commit b2f4f63a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'issue_8843' into 'master'

Fix  related issues not being shown

Closes #8836 and #8843

See merge request gitlab-org/gitlab-ee!8865
parents 18d89a42 d9303dc4
...@@ -48,7 +48,7 @@ module IssuableLinks ...@@ -48,7 +48,7 @@ module IssuableLinks
path: issuable_path(object), path: issuable_path(object),
relation_path: relation_path(object), relation_path: relation_path(object),
due_date: object.due_date, due_date: object.due_date,
created_at: object.created_at&.to_s, created_at: object.created_at,
closed_at: object.closed_at closed_at: object.closed_at
} }
end end
......
...@@ -7,9 +7,12 @@ describe EpicIssues::ListService do ...@@ -7,9 +7,12 @@ describe EpicIssues::ListService do
let(:other_project) { create(:project_empty_repo, group: group) } let(:other_project) { create(:project_empty_repo, group: group) }
let(:epic) { create(:epic, group: group) } let(:epic) { create(:epic, group: group) }
let(:issue1) { create :issue, project: project, weight: 1 } # Reloading issues here is needed because when storing datetime on postgres
let(:issue2) { create :issue, project: project } # nanoseconds precision is ignored when fetching records but not when inserting,
let(:issue3) { create :issue, project: other_project } # which makes the expectations fails for created_at field.
let!(:issue1) { create(:issue, project: project, weight: 1).reload }
let!(:issue2) { create(:issue, project: project).reload }
let!(:issue3) { create(:issue, project: other_project).reload }
let!(:epic_issue1) { create(:epic_issue, issue: issue1, epic: epic, relative_position: 2) } let!(:epic_issue1) { create(:epic_issue, issue: issue1, epic: epic, relative_position: 2) }
let!(:epic_issue2) { create(:epic_issue, issue: issue2, epic: epic, relative_position: 1) } let!(:epic_issue2) { create(:epic_issue, issue: issue2, epic: epic, relative_position: 1) }
...@@ -81,7 +84,7 @@ describe EpicIssues::ListService do ...@@ -81,7 +84,7 @@ describe EpicIssues::ListService do
relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue2.id}", relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue2.id}",
epic_issue_id: epic_issue2.id, epic_issue_id: epic_issue2.id,
due_date: nil, due_date: nil,
created_at: issue2.created_at.to_s, created_at: issue2.created_at,
closed_at: issue2.closed_at closed_at: issue2.closed_at
}, },
{ {
...@@ -97,7 +100,7 @@ describe EpicIssues::ListService do ...@@ -97,7 +100,7 @@ describe EpicIssues::ListService do
relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue1.id}", relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue1.id}",
epic_issue_id: epic_issue1.id, epic_issue_id: epic_issue1.id,
due_date: nil, due_date: nil,
created_at: issue1.created_at.to_s, created_at: issue1.created_at,
closed_at: issue1.closed_at closed_at: issue1.closed_at
}, },
{ {
...@@ -113,7 +116,7 @@ describe EpicIssues::ListService do ...@@ -113,7 +116,7 @@ describe EpicIssues::ListService do
relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue3.id}", relation_path: "/groups/#{group.full_path}/-/epics/#{epic.iid}/issues/#{epic_issue3.id}",
epic_issue_id: epic_issue3.id, epic_issue_id: epic_issue3.id,
due_date: nil, due_date: nil,
created_at: issue3.created_at.to_s, created_at: issue3.created_at,
closed_at: issue3.closed_at closed_at: issue3.closed_at
} }
] ]
...@@ -142,7 +145,7 @@ describe EpicIssues::ListService do ...@@ -142,7 +145,7 @@ describe EpicIssues::ListService do
relation_path: nil, relation_path: nil,
epic_issue_id: epic_issue2.id, epic_issue_id: epic_issue2.id,
due_date: nil, due_date: nil,
created_at: issue2.created_at.to_s, created_at: issue2.created_at,
closed_at: issue2.closed_at closed_at: issue2.closed_at
}, },
{ {
...@@ -158,7 +161,7 @@ describe EpicIssues::ListService do ...@@ -158,7 +161,7 @@ describe EpicIssues::ListService do
relation_path: nil, relation_path: nil,
epic_issue_id: epic_issue1.id, epic_issue_id: epic_issue1.id,
due_date: nil, due_date: nil,
created_at: issue1.created_at.to_s, created_at: issue1.created_at,
closed_at: issue1.closed_at closed_at: issue1.closed_at
} }
] ]
......
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