diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/services/ci/play_build_service_spec.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/services/ci/play_build_service_spec.rb')
-rw-r--r-- | spec/services/ci/play_build_service_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/services/ci/play_build_service_spec.rb b/spec/services/ci/play_build_service_spec.rb index 34f77260334..85ef8b60af4 100644 --- a/spec/services/ci/play_build_service_spec.rb +++ b/spec/services/ci/play_build_service_spec.rb @@ -122,7 +122,7 @@ RSpec.describe Ci::PlayBuildService, '#execute' do end context 'when build is not a playable manual action' do - let(:build) { create(:ci_build, when: :manual, pipeline: pipeline) } + let(:build) { create(:ci_build, :success, pipeline: pipeline) } let!(:branch) { create(:protected_branch, :developers_can_merge, name: build.ref, project: project) } it 'duplicates the build' do @@ -138,6 +138,18 @@ RSpec.describe Ci::PlayBuildService, '#execute' do expect(build.user).not_to eq user expect(duplicate.user).to eq user end + + context 'and is not retryable' do + let(:build) { create(:ci_build, :deployment_rejected, pipeline: pipeline) } + + it 'does not duplicate the build' do + expect { service.execute(build) }.not_to change { Ci::Build.count } + end + + it 'does not enqueue the build' do + expect { service.execute(build) }.not_to change { build.status } + end + end end context 'when build is not action' do |