diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-13 18:06:11 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-13 18:06:11 +0000 |
commit | b8f67b4ddf6b4a56fc25565d66230fc6e78ba72d (patch) | |
tree | 882af00a70d099a617c8f9acefb048351b32c9ee /spec/requests | |
parent | d2c9e8ab6e696f9b2dd3abcddd7cb526e8057a14 (diff) | |
parent | 228073986bfb900ef324379639e1c5cce6b74fe6 (diff) | |
download | gitlab-ce-b8f67b4ddf6b4a56fc25565d66230fc6e78ba72d.tar.gz |
Merge branch 'dropdown-load-fix' into 'master'
Dropdown loading time preformance fix
## What does this MR do?
Optimizes the performance of the dropdown load time by just sending the required data to load the dropdown instead of the full object
This MR aims to fix #17474
See merge request !5113
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 8a52725a893..152cd802839 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -81,6 +81,18 @@ describe API::API, api: true do expect(json_response.first.keys).not_to include('open_issues_count') end + context 'GET /projects?simple=true' do + it 'returns a simplified version of all the projects' do + expected_keys = ["id", "http_url_to_repo", "web_url", "name", "name_with_namespace", "path", "path_with_namespace"] + + get api('/projects?simple=true', user) + + expect(response).to have_http_status(200) + expect(json_response).to be_an Array + expect(json_response.first.keys).to match_array expected_keys + end + end + context 'and using search' do it 'should return searched project' do get api('/projects', user), { search: project.name } |