diff options
author | Rémy Coutable <remy@rymai.me> | 2016-12-13 16:52:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-12-13 16:52:42 +0000 |
commit | 75b0627fd4c811d4fae4e85b1e303f2dbcab6786 (patch) | |
tree | b5aee652915e0d52c99eda4124069a28b2c205e2 /spec | |
parent | 921673b0da9df73528b3e10e503a2eda4f44b07b (diff) | |
parent | 7841be243e5f28828cea95500b554d7f5cc039eb (diff) | |
download | gitlab-ce-75b0627fd4c811d4fae4e85b1e303f2dbcab6786.tar.gz |
Merge branch 'api-simple-group-project' into 'master'
API: Ability to get group's project in simple representation
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/25412
See merge request !8060
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/groups_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 15647b262b6..a75ba824e85 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -243,17 +243,28 @@ describe API::Groups, api: true do expect(json_response.length).to eq(2) project_names = json_response.map { |proj| proj['name' ] } expect(project_names).to match_array([project1.name, project3.name]) + expect(json_response.first['default_branch']).to be_present + end + + it "returns the group's projects with simple representation" do + get api("/groups/#{group1.id}/projects", user1), simple: true + + expect(response).to have_http_status(200) + expect(json_response.length).to eq(2) + project_names = json_response.map { |proj| proj['name' ] } + expect(project_names).to match_array([project1.name, project3.name]) + expect(json_response.first['default_branch']).not_to be_present end it 'filters the groups projects' do - public_projet = create(:project, :public, path: 'test1', group: group1) + public_project = create(:project, :public, path: 'test1', group: group1) get api("/groups/#{group1.id}/projects", user1), visibility: 'public' expect(response).to have_http_status(200) expect(json_response).to be_an(Array) expect(json_response.length).to eq(1) - expect(json_response.first['name']).to eq(public_projet.name) + expect(json_response.first['name']).to eq(public_project.name) end it "does not return a non existing group" do |