summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-05-10 19:02:00 +0200
committerFilipa Lacerda <filipa@gitlab.com>2019-05-24 10:04:35 +0100
commit6ef27f77447ad389ca9b508909964c127fd38eeb (patch)
treeefd9aa2c7a1b029acc798fba446c1434ba9aa6bf /spec/serializers
parenta96b9ebfbeb7926fdee632f0eeef9e09a63bec21 (diff)
downloadgitlab-ce-6ef27f77447ad389ca9b508909964c127fd38eeb.tar.gz
Expose build environment latest deployable name and path
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/build_details_entity_spec.rb2
-rw-r--r--spec/serializers/deployment_entity_spec.rb11
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