diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-29 12:06:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-29 12:06:31 +0300 |
commit | 6b13a226ddfc49140d58e7e88f8703ae0ed90574 (patch) | |
tree | 9a92431e484354f43230fa87adc00a2edbf6f09c /spec/serializers/deployment_entity_spec.rb | |
parent | 2ac93cb80c4c0a57fde86de8262b569d1e9b9e51 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/deployment_entity_spec.rb')
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index d7816a3503d..2a57ea51b39 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -107,6 +107,36 @@ describe DeploymentEntity do end end + describe 'playable_build' do + let_it_be(:project) { create(:project, :repository) } + + context 'when the deployment has a playable deployable' do + context 'when this build is ready to be played' do + let(:build) { create(:ci_build, :playable, :scheduled, pipeline: pipeline) } + + it 'exposes only the play_path' do + expect(subject[:playable_build].keys).to contain_exactly(:play_path) + end + end + + context 'when this build has failed' do + let(:build) { create(:ci_build, :playable, :failed, pipeline: pipeline) } + + it 'exposes the play_path and the retry_path' do + expect(subject[:playable_build].keys).to contain_exactly(:play_path, :retry_path) + end + end + end + + context 'when the deployment does not have a playable deployable' do + let(:build) { create(:ci_build) } + + it 'is not exposed' do + expect(subject[:playable_build]).to be_nil + end + end + end + context 'when deployment details serialization was disabled' do include Gitlab::Routing |