Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7678e702
Commit
7678e702
authored
May 25, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop forcing ID saving on tests
parent
538c76f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
44 deletions
+29
-44
spec/services/issue_links/list_service_spec.rb
spec/services/issue_links/list_service_spec.rb
+29
-44
No files found.
spec/services/issue_links/list_service_spec.rb
View file @
7678e702
...
...
@@ -19,20 +19,17 @@ describe IssueLinks::ListService, service: true do
let
(
:issue_d
)
{
create
:issue
,
project:
project
}
let!
(
:issue_link_c
)
do
create
(
:issue_link
,
id:
999
,
source:
issue_d
,
create
(
:issue_link
,
source:
issue_d
,
target:
issue
)
end
let!
(
:issue_link_b
)
do
create
(
:issue_link
,
id:
998
,
source:
issue
,
create
(
:issue_link
,
source:
issue
,
target:
issue_c
)
end
let!
(
:issue_link_a
)
do
create
(
:issue_link
,
id:
997
,
source:
issue
,
create
(
:issue_link
,
source:
issue
,
target:
issue_b
)
end
...
...
@@ -44,44 +41,32 @@ describe IssueLinks::ListService, service: true do
it
'returns related issues JSON'
do
expect
(
subject
.
size
).
to
eq
(
3
)
expect
(
subject
[
0
]).
to
eq
(
{
id:
issue_b
.
id
,
iid:
issue_b
.
iid
,
title:
issue_b
.
title
,
state:
issue_b
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_b
.
iid
}
"
,
project_path:
issue_b
.
project
.
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
}
"
}
)
expect
(
subject
[
1
]).
to
eq
(
{
id:
issue_c
.
id
,
iid:
issue_c
.
iid
,
title:
issue_c
.
title
,
state:
issue_c
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_c
.
iid
}
"
,
project_path:
issue_c
.
project
.
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
}
"
}
)
expect
(
subject
[
2
]).
to
eq
(
{
id:
issue_d
.
id
,
iid:
issue_d
.
iid
,
title:
issue_d
.
title
,
state:
issue_d
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_d
.
iid
}
"
,
project_path:
issue_d
.
project
.
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
}
"
}
)
expect
(
subject
).
to
include
(
include
(
id:
issue_b
.
id
,
iid:
issue_b
.
iid
,
title:
issue_b
.
title
,
state:
issue_b
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_b
.
iid
}
"
,
project_path:
issue_b
.
project
.
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
}
"
))
expect
(
subject
).
to
include
(
include
(
id:
issue_c
.
id
,
iid:
issue_c
.
iid
,
title:
issue_c
.
title
,
state:
issue_c
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_c
.
iid
}
"
,
project_path:
issue_c
.
project
.
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
}
"
))
expect
(
subject
).
to
include
(
include
(
id:
issue_d
.
id
,
iid:
issue_d
.
iid
,
title:
issue_d
.
title
,
state:
issue_d
.
state
,
path:
"/
#{
project
.
full_path
}
/issues/
#{
issue_d
.
iid
}
"
,
project_path:
issue_d
.
project
.
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
}
"
))
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment