Commit 7678e702 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Stop forcing ID saving on tests

parent 538c76f0
...@@ -19,20 +19,17 @@ describe IssueLinks::ListService, service: true do ...@@ -19,20 +19,17 @@ describe IssueLinks::ListService, service: true do
let(:issue_d) { create :issue, project: project } let(:issue_d) { create :issue, project: project }
let!(:issue_link_c) do let!(:issue_link_c) do
create(:issue_link, id: 999, create(:issue_link, source: issue_d,
source: issue_d,
target: issue) target: issue)
end end
let!(:issue_link_b) do let!(:issue_link_b) do
create(:issue_link, id: 998, create(:issue_link, source: issue,
source: issue,
target: issue_c) target: issue_c)
end end
let!(:issue_link_a) do let!(:issue_link_a) do
create(:issue_link, id: 997, create(:issue_link, source: issue,
source: issue,
target: issue_b) target: issue_b)
end end
...@@ -44,44 +41,32 @@ describe IssueLinks::ListService, service: true do ...@@ -44,44 +41,32 @@ describe IssueLinks::ListService, service: true do
it 'returns related issues JSON' do it 'returns related issues JSON' do
expect(subject.size).to eq(3) expect(subject.size).to eq(3)
expect(subject[0]).to eq( expect(subject).to include(include(id: issue_b.id,
{
id: issue_b.id,
iid: issue_b.iid, iid: issue_b.iid,
title: issue_b.title, title: issue_b.title,
state: issue_b.state, state: issue_b.state,
path: "/#{project.full_path}/issues/#{issue_b.iid}", path: "/#{project.full_path}/issues/#{issue_b.iid}",
project_path: issue_b.project.path, project_path: issue_b.project.path,
namespace_full_path: issue_b.project.namespace.full_path, namespace_full_path: issue_b.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_b.iid}/links/#{issue_link_a.id}" destroy_relation_path: "/#{project.full_path}/issues/#{issue_b.iid}/links/#{issue_link_a.id}"))
}
)
expect(subject[1]).to eq( expect(subject).to include(include(id: issue_c.id,
{
id: issue_c.id,
iid: issue_c.iid, iid: issue_c.iid,
title: issue_c.title, title: issue_c.title,
state: issue_c.state, state: issue_c.state,
path: "/#{project.full_path}/issues/#{issue_c.iid}", path: "/#{project.full_path}/issues/#{issue_c.iid}",
project_path: issue_c.project.path, project_path: issue_c.project.path,
namespace_full_path: issue_c.project.namespace.full_path, namespace_full_path: issue_c.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_c.iid}/links/#{issue_link_b.id}" destroy_relation_path: "/#{project.full_path}/issues/#{issue_c.iid}/links/#{issue_link_b.id}"))
}
)
expect(subject[2]).to eq( expect(subject).to include(include(id: issue_d.id,
{
id: issue_d.id,
iid: issue_d.iid, iid: issue_d.iid,
title: issue_d.title, title: issue_d.title,
state: issue_d.state, state: issue_d.state,
path: "/#{project.full_path}/issues/#{issue_d.iid}", path: "/#{project.full_path}/issues/#{issue_d.iid}",
project_path: issue_d.project.path, project_path: issue_d.project.path,
namespace_full_path: issue_d.project.namespace.full_path, namespace_full_path: issue_d.project.namespace.full_path,
destroy_relation_path: "/#{project.full_path}/issues/#{issue_d.iid}/links/#{issue_link_c.id}" destroy_relation_path: "/#{project.full_path}/issues/#{issue_d.iid}/links/#{issue_link_c.id}"))
}
)
end end
end end
......
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