Skip to content
Snippets Groups Projects
Commit 98ac988d authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Use order instead of reorder. Improve tests.

parent 8f32724f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -118,6 +118,6 @@ class PipelinesFinder
else
:desc
end
items.reorder(order_by => sort)
items.order(order_by => sort)
end
end
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment