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
98ac988d
Commit
98ac988d
authored
Mar 19, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use order instead of reorder. Improve tests.
parent
8f32724f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
app/finders/pipelines_finder.rb
app/finders/pipelines_finder.rb
+1
-1
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+5
-2
No files found.
app/finders/pipelines_finder.rb
View file @
98ac988d
...
...
@@ -118,6 +118,6 @@ class PipelinesFinder
else
:desc
end
items
.
re
order
(
order_by
=>
sort
)
items
.
order
(
order_by
=>
sort
)
end
end
spec/requests/api/pipelines_spec.rb
View file @
98ac988d
...
...
@@ -225,8 +225,11 @@ describe API::Pipelines do
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
project
.
pipelines
.
order
(
user_id: :asc
).
first
.
id
)
expect
(
json_response
.
last
[
'id'
]).
to
eq
(
project
.
pipelines
.
order
(
user_id: :asc
).
last
.
id
)
expect
(
json_response
).
not_to
be_empty
pipelines
=
project
.
pipelines
.
order
(
user_id: :asc
)
json_response
.
each_with_index
do
|
r
,
i
|
expect
(
r
[
'id'
]).
to
eq
(
pipelines
[
i
].
id
)
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