diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-16 08:51:27 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-18 21:10:52 +0200 |
commit | 39c71a19c468736a94f642173a54bf72b2dc1689 (patch) | |
tree | a6fe1f44cf9ab8e54c5398613d8643bf32023f13 | |
parent | 47d6f286eb565ae582def5a28af2cb450b2ee479 (diff) | |
download | gitlab-ce-39c71a19c468736a94f642173a54bf72b2dc1689.tar.gz |
Expose project for environments
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | spec/requests/api/environments_spec.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 9ae68947379..a10951b9ea0 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -512,6 +512,7 @@ module API class Environment < Grape::Entity expose :id, :name, :external_url + expose :project, using: Entities::Project end class EnvironmentBasic < Grape::Entity diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb index 05e57905343..1898b07835d 100644 --- a/spec/requests/api/environments_spec.rb +++ b/spec/requests/api/environments_spec.rb @@ -26,6 +26,7 @@ describe API::API, 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) end end |