diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-11-05 14:45:36 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-11-05 14:45:36 +0300 |
commit | 425ddcc5a8f65b44546daa8c1885e4e4f45e5f32 (patch) | |
tree | 686da2eb8ee8755f7e1bcd7a91c61559638fe547 /spec/serializers | |
parent | 2ae6c47ddd27d9f76bc2e4326e91fc8d272896c1 (diff) | |
parent | 13c091c443502a6824b78c4e93637b3fc794a47c (diff) |
Merge branch 'scheduled-manual-jobs-environment-play-buttons' into 'master'
Add the Play button for delayed jobs in environment page
Closes #52129
See merge request gitlab-org/gitlab-ce!22106
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index 522c92ce295..8793a762f9d 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -22,4 +22,26 @@ describe DeploymentEntity do it 'exposes creation date' do expect(subject).to include(:created_at) end + + describe 'scheduled_actions' do + let(:project) { create(:project, :repository) } + let(:pipeline) { create(:ci_pipeline, project: project, user: user) } + let(:build) { create(:ci_build, :success, pipeline: pipeline) } + let(:deployment) { create(:deployment, deployable: build) } + + context 'when the same pipeline has a scheduled action' do + let(:other_build) { create(:ci_build, :schedulable, :success, pipeline: pipeline, name: 'other build') } + let!(:other_deployment) { create(:deployment, deployable: other_build) } + + it 'returns other scheduled actions' do + expect(subject[:scheduled_actions][0][:name]).to eq 'other build' + end + end + + context 'when the same pipeline does not have a scheduled action' do + it 'does not return other actions' do + expect(subject[:scheduled_actions]).to be_empty + end + end + end end |