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
Boxiang Sun
gitlab-ce
Commits
4fe7c255
Commit
4fe7c255
authored
Apr 27, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve pipelines_finder.rb
parent
255bfd65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/finders/pipelines_finder_spec.rb
spec/finders/pipelines_finder_spec.rb
+4
-4
No files found.
spec/finders/pipelines_finder_spec.rb
View file @
4fe7c255
...
@@ -11,7 +11,7 @@ describe PipelinesFinder do
...
@@ -11,7 +11,7 @@ describe PipelinesFinder do
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
it
'returns all pipelines'
do
it
'returns all pipelines'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
}
)
is_expected
.
to
match_array
(
pipelines
)
end
end
end
end
...
@@ -35,7 +35,7 @@ describe PipelinesFinder do
...
@@ -35,7 +35,7 @@ describe PipelinesFinder do
end
end
it
'returns matched pipelines'
do
it
'returns matched pipelines'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
}
)
is_expected
.
to
match_array
(
pipelines
)
end
end
end
end
...
@@ -162,7 +162,7 @@ describe PipelinesFinder do
...
@@ -162,7 +162,7 @@ describe PipelinesFinder do
let
(
:params
)
{
{
yaml_errors:
"invalid-yaml_errors"
}
}
let
(
:params
)
{
{
yaml_errors:
"invalid-yaml_errors"
}
}
it
'returns all pipelines'
do
it
'returns all pipelines'
do
is_expected
.
to
eq
([
pipeline1
,
pipeline2
].
sort_by
{
|
p
|
-
p
.
id
}
)
is_expected
.
to
match_array
([
pipeline1
,
pipeline2
]
)
end
end
end
end
end
end
...
@@ -173,7 +173,7 @@ describe PipelinesFinder do
...
@@ -173,7 +173,7 @@ describe PipelinesFinder do
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
,
user:
create
(
:user
))
}
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
,
user:
create
(
:user
))
}
it
'sorts as user_id: :asc'
do
it
'sorts as user_id: :asc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
user
.
id
}
)
is_expected
.
to
match_array
(
pipelines
)
end
end
context
'when sort is invalid'
do
context
'when sort is invalid'
do
...
...
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