diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-02 17:36:21 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-06 14:00:38 -0300 |
commit | fa0c0bb00692c77c0d01865dc17ec2b5e71bcc91 (patch) | |
tree | ad5a1eed2aba68ab70b61f074052d99e825cc556 /spec/requests/api/environments_spec.rb | |
parent | b63c41e12e9e6f7e9fd1d79bedf56bd42cc17035 (diff) | |
download | gitlab-ce-fa0c0bb00692c77c0d01865dc17ec2b5e71bcc91.tar.gz |
Narrow environment payload by using basic project details resource28598-narrow-environment-payload-by-using-basic-project
Diffstat (limited to 'spec/requests/api/environments_spec.rb')
-rw-r--r-- | spec/requests/api/environments_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb index f2fd1dfc8db..b54ee8e8b85 100644 --- a/spec/requests/api/environments_spec.rb +++ b/spec/requests/api/environments_spec.rb @@ -15,6 +15,8 @@ describe API::Environments, api: true do describe 'GET /projects/:id/environments' do context 'as member of the project' do it 'returns project environments' do + project_data_keys = %w(id http_url_to_repo web_url name name_with_namespace path path_with_namespace) + get api("/projects/#{project.id}/environments", user) expect(response).to have_http_status(200) @@ -23,8 +25,7 @@ describe API::Environments, api: true do expect(json_response.size).to eq(1) expect(json_response.first['name']).to eq(environment.name) expect(json_response.first['external_url']).to eq(environment.external_url) - expect(json_response.first['project']['id']).to eq(project.id) - expect(json_response.first['project']['visibility']).to be_present + expect(json_response.first['project'].keys).to contain_exactly(*project_data_keys) end end |