diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-05-10 20:02:00 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-05-24 12:04:35 +0300 |
commit | 6ef27f77447ad389ca9b508909964c127fd38eeb (patch) | |
tree | efd9aa2c7a1b029acc798fba446c1434ba9aa6bf /spec/serializers | |
parent | a96b9ebfbeb7926fdee632f0eeef9e09a63bec21 (diff) |
Expose build environment latest deployable name and path
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/build_details_entity_spec.rb | 2 | ||||
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 68cf428ed38..9c2e5c79a9d 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -142,7 +142,7 @@ describe BuildDetailsEntity do response = subject.with_indifferent_access response.dig(:deployment_status, :environment, :last_deployment).tap do |deployment| - expect(deployment).not_to include(:commit, :deployable, :manual_actions, :scheduled_actions) + expect(deployment).not_to include(:commit, :manual_actions, :scheduled_actions) end end end diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index f0bbf90c6c6..37614cc0b4c 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -93,13 +93,22 @@ describe DeploymentEntity do end context 'when deployment details serialization was disabled' do + include Gitlab::Routing + let(:entity) do described_class.new(deployment, request: request, deployment_details: false) end it 'does not serialize deployment details' do expect(subject.with_indifferent_access) - .not_to include(:commit, :deployable, :manual_actions, :scheduled_actions) + .not_to include(:commit, :manual_actions, :scheduled_actions) + end + + it 'only exposes deployable name and path' do + project_job_path(project, deployment.deployable).tap do |path| + expect(subject.fetch(:deployable)) + .to eq('name' => 'test', 'build_path' => path) + end end end end |