summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2019-06-24 09:19:27 +0000
committerDouwe Maan <douwe@gitlab.com>2019-06-24 09:19:27 +0000
commit6177bc1d69ca4870672a9db1af3b5f6798674676 (patch)
treec768bffb24322024a636ae182a6144f62a59eb7c /spec/workers
parent74c8f7848e1da93b99e2e7fe06d1098ae1fa7357 (diff)
parent26b057293d18f35367e39882f3724372b616dc51 (diff)
downloadgitlab-ce-6177bc1d69ca4870672a9db1af3b5f6798674676.tar.gz
Merge branch 'remove_create_deployment_from_build_success_worker' into 'master'
Remove deprecated call in BuildSuccessWorker Closes #63622 See merge request gitlab-org/gitlab-ce!29958
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/build_success_worker_spec.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/spec/workers/build_success_worker_spec.rb b/spec/workers/build_success_worker_spec.rb
index ffe8796ded9..f4ff8cb15f8 100644
--- a/spec/workers/build_success_worker_spec.rb
+++ b/spec/workers/build_success_worker_spec.rb
@@ -6,51 +6,7 @@ describe BuildSuccessWorker do
describe '#perform' do
subject { described_class.new.perform(build.id) }
- before do
- allow_any_instance_of(Deployment).to receive(:create_ref)
- end
-
context 'when build exists' do
- context 'when deployment was not created with the build creation' do # An edge case during the transition period
- let!(:build) { create(:ci_build, :deploy_to_production) }
-
- before do
- allow(Deployments::FinishedWorker).to receive(:perform_async)
- Deployment.delete_all
- build.reload
- end
-
- it 'creates a successful deployment' do
- expect(build).not_to be_has_deployment
-
- subject
-
- build.reload
- expect(build).to be_has_deployment
- expect(build.deployment).to be_success
- end
- end
-
- context 'when deployment was created with the build creation' do # Counter part of the above edge case
- let!(:build) { create(:ci_build, :deploy_to_production) }
-
- it 'does not create a new deployment' do
- expect(build).to be_has_deployment
-
- expect { subject }.not_to change { Deployment.count }
- end
- end
-
- context 'when build is not associated with project' do
- let!(:build) { create(:ci_build, project: nil) }
-
- it 'does not create deployment' do
- subject
-
- expect(build.reload).not_to be_has_deployment
- end
- end
-
context 'when the build will stop an environment' do
let!(:build) { create(:ci_build, :stop_review_app, environment: environment.name, project: environment.project) }
let(:environment) { create(:environment, state: :available) }