diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-13 13:51:30 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-13 13:54:36 +0100 |
commit | 7841be243e5f28828cea95500b554d7f5cc039eb (patch) | |
tree | f9c4dcc6f5015323f65025dcfe693a8e52ca0f3f /spec | |
parent | 9a3c53fd4e79b73e51c8aadeb8a996db65088811 (diff) | |
download | gitlab-ce-7841be243e5f28828cea95500b554d7f5cc039eb.tar.gz |
API: Ability to get group's project in simple representationapi-simple-group-project
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 |