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
c79c3895
Commit
c79c3895
authored
Mar 17, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix created_at to user_id in spec
parent
e72c50fc
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 @
c79c3895
...
...
@@ -206,26 +206,26 @@ describe PipelinesFinder do
context
'when order_by and sort are passed'
do
context
'when order_by and sort are valid'
do
let
(
:params
)
{
{
order_by:
'
created_at
'
,
sort:
'asc'
}
}
let
(
:params
)
{
{
order_by:
'
user_id
'
,
sort:
'asc'
}
}
it
'sorts pipelines by default'
do
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
created_at
: :asc
))
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
user_id
: :asc
))
end
end
context
'when order_by is invalid'
do
let
(
:params
)
{
{
order_by:
'invalid_column'
,
sort:
'
de
sc'
}
}
let
(
:params
)
{
{
order_by:
'invalid_column'
,
sort:
'
a
sc'
}
}
it
'sorts pipelines with default order_by (id:)'
do
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
id: :
de
sc
))
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
id: :
a
sc
))
end
end
context
'when sort is invalid'
do
let
(
:params
)
{
{
order_by:
'
created_at
'
,
sort:
'invalid_sort'
}
}
let
(
:params
)
{
{
order_by:
'
user_id
'
,
sort:
'invalid_sort'
}
}
it
'sorts pipelines with default sort (:desc)'
do
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
created_at
: :desc
))
expect
(
subject
).
to
eq
(
Ci
::
Pipeline
.
order
(
user_id
: :desc
))
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