Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-05-14 15:49:09 +0300
committerValery Sizov <vsv2711@gmail.com>2015-05-14 15:49:09 +0300
commit7c3ca86370afd28306e5bcc6563ff03da0343536 (patch)
tree366873e8e1ddcb03911c4339c024fa99962c73ec /spec/requests
parent5619c7b9687edbeb07f4f383bd0bd1a1d94a1b50 (diff)
Add order option for projects API
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index cc387378d3a..aada7febf6c 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -86,6 +86,15 @@ describe API::API, api: true do
expect(json_response).to be_an Array
expect(json_response.first['id']).to eq(project3.id)
end
+
+ it 'returns projects in the correct order when ci_enabled_first parameter is passed' do
+ [project, project2, project3].each{ |project| project.build_missing_services }
+ project2.gitlab_ci_service.update(active: true, token: "token", project_url: "url")
+ get api('/projects', user), { ci_enabled_first: 'true'}
+ expect(response.status).to eq(200)
+ expect(json_response).to be_an Array
+ expect(json_response.first['id']).to eq(project2.id)
+ end
end
end
end