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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
fda48d30
Commit
fda48d30
authored
Mar 29, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve api/pipelines_spec.rb
parent
7d48cb01
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
95 deletions
+112
-95
spec/finders/pipelines_finder_spec.rb
spec/finders/pipelines_finder_spec.rb
+7
-3
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+105
-92
No files found.
spec/finders/pipelines_finder_spec.rb
View file @
fda48d30
...
...
@@ -28,10 +28,14 @@ describe PipelinesFinder do
context
'when scope is finished'
do
let
(
:params
)
{
{
scope:
'finished'
}
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
status:
'success'
)
}
let!
(
:pipelines
)
do
[
create
(
:ci_pipeline
,
project:
project
,
status:
'success'
),
create
(
:ci_pipeline
,
project:
project
,
status:
'failed'
),
create
(
:ci_pipeline
,
project:
project
,
status:
'canceled'
)]
end
it
'returns matched pipelines'
do
is_expected
.
to
eq
(
[
pipeline
]
)
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
}
)
end
end
...
...
@@ -168,7 +172,7 @@ describe PipelinesFinder do
let
(
:params
)
{
{
order_by:
'user_id'
,
sort:
'asc'
}
}
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
,
user:
create
(
:user
))
}
it
'sorts as user_id: :
de
sc'
do
it
'sorts as user_id: :
a
sc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
user
.
id
})
end
...
...
spec/requests/api/pipelines_spec.rb
View file @
fda48d30
This diff is collapsed.
Click to expand it.
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