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
Léo-Paul Géneau
gitlab-ce
Commits
6f83553a
Commit
6f83553a
authored
Mar 29, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add space before bracket
parent
67369388
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
spec/finders/pipelines_finder_spec.rb
spec/finders/pipelines_finder_spec.rb
+6
-6
No files found.
spec/finders/pipelines_finder_spec.rb
View file @
6f83553a
...
@@ -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
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
})
end
end
end
end
...
@@ -153,7 +153,7 @@ describe PipelinesFinder do
...
@@ -153,7 +153,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
eq
([
pipeline1
,
pipeline2
].
sort_by
{
|
p
|
-
p
.
id
})
end
end
end
end
end
end
...
@@ -164,14 +164,14 @@ describe PipelinesFinder do
...
@@ -164,14 +164,14 @@ 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: :desc'
do
it
'sorts as user_id: :desc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
user
.
id
})
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
user
.
id
})
end
end
context
'when sort is invalid'
do
context
'when sort is invalid'
do
let
(
:params
)
{
{
order_by:
'user_id'
,
sort:
'invalid_sort'
}
}
let
(
:params
)
{
{
order_by:
'user_id'
,
sort:
'invalid_sort'
}
}
it
'sorts as user_id: :desc'
do
it
'sorts as user_id: :desc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
user
.
id
})
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
user
.
id
})
end
end
end
end
end
end
...
@@ -181,7 +181,7 @@ describe PipelinesFinder do
...
@@ -181,7 +181,7 @@ describe PipelinesFinder do
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
it
'sorts as id: :asc'
do
it
'sorts as id: :asc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
id
})
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
p
.
id
})
end
end
end
end
...
@@ -190,7 +190,7 @@ describe PipelinesFinder do
...
@@ -190,7 +190,7 @@ describe PipelinesFinder do
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
let!
(
:pipelines
)
{
create_list
(
:ci_pipeline
,
2
,
project:
project
)
}
it
'sorts as id: :desc'
do
it
'sorts as id: :desc'
do
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
})
is_expected
.
to
eq
(
pipelines
.
sort_by
{
|
p
|
-
p
.
id
})
end
end
end
end
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