summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
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