Commit cf2ec7d8 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Return project and namespace full path, and issue IID on RelatedIssues::ListService

parent 238ef8a1
......@@ -10,8 +10,11 @@ module RelatedIssues
issues.map do |referenced_issue|
{
title: referenced_issue.title,
iid: referenced_issue.iid,
state: referenced_issue.state,
reference: referenced_issue.to_reference(@issue.project),
project_full_path: referenced_issue.project.full_path,
namespace_full_path: referenced_issue.project.namespace.full_path,
path: namespace_project_issue_path(referenced_issue.project.namespace, referenced_issue.project, referenced_issue.iid),
destroy_relation_path: destroy_relation_path(referenced_issue)
}
......
......@@ -46,9 +46,12 @@ describe RelatedIssues::ListService, service: true do
expect(subject[0]).to eq(
{
title: issue_b.title,
iid: issue_b.iid,
state: issue_b.state,
reference: issue_b.to_reference(project),
path: "/#{project.full_path}/issues/#{issue_b.iid}",
project_full_path: issue_b.project.full_path,
namespace_full_path: issue_b.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_b.iid}/related_issues/#{related_issue_a.id}"
}
)
......@@ -56,9 +59,12 @@ describe RelatedIssues::ListService, service: true do
expect(subject[1]).to eq(
{
title: issue_c.title,
iid: issue_c.iid,
state: issue_c.state,
reference: issue_c.to_reference(project),
path: "/#{project.full_path}/issues/#{issue_c.iid}",
project_full_path: issue_c.project.full_path,
namespace_full_path: issue_c.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_c.iid}/related_issues/#{related_issue_b.id}"
}
)
......@@ -66,9 +72,12 @@ describe RelatedIssues::ListService, service: true do
expect(subject[2]).to eq(
{
title: issue_d.title,
iid: issue_d.iid,
state: issue_d.state,
reference: issue_d.to_reference(project),
path: "/#{project.full_path}/issues/#{issue_d.iid}",
project_full_path: issue_d.project.full_path,
namespace_full_path: issue_d.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_d.iid}/related_issues/#{related_issue_c.id}"
}
)
......
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