diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-08-27 10:51:28 +0700 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-08-30 18:45:00 +0700 |
commit | f246db4446466de58ba8618fb77bea63ca976551 (patch) | |
tree | 2731e145a0d7c77230de01e3c1c3d6b30d8efffb /spec/serializers/deployment_entity_spec.rb | |
parent | 153f25af9ccb3b35f0dc4111afc4da5112c27b13 (diff) | |
download | gitlab-ce-f246db4446466de58ba8618fb77bea63ca976551.tar.gz |
Fix deployable nil exception on job controllerfix-nil-deployable-exception-on-job-controller-show
When deployable is nil, we gracefully take care of the case.
Diffstat (limited to 'spec/serializers/deployment_entity_spec.rb')
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index 1b19eac9a97..79f89dc1a9c 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -36,6 +36,15 @@ describe DeploymentEntity do expect(subject).to include(:deployed_at) end + context 'when deployable is nil' do + let(:entity) { described_class.new(deployment, request: request, deployment_details: false) } + let(:deployment) { create(:deployment, deployable: nil, project: project) } + + it 'does not expose deployable entry' do + expect(subject).not_to include(:deployable) + end + end + context 'when the pipeline has another manual action' do let(:other_build) { create(:ci_build, :manual, name: 'another deploy', pipeline: pipeline) } let!(:other_deployment) { create(:deployment, deployable: other_build) } |