summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-17 07:20:52 +0000
committerLin Jen-Shin <godfat@godfat.org>2016-10-17 07:20:52 +0000
commit09a7da7222d535948eadcf53c821360b037f7f6b (patch)
tree15d0844efcb97db1eeb5cac5b42b54ca6b4d4bac /spec/services
parent43973223af6755c8213e639e616bc788d7c0493c (diff)
parentcb8654e85650ba6107031cc978d882f4b2f272cf (diff)
downloadgitlab-ce-09a7da7222d535948eadcf53c821360b037f7f6b.tar.gz
Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (148 commits) Fix broken rspec in compare text Added logic to handle a revision input that does not exist in the menu Fix broken Spinach tests caused by changes in !6550 Convert CHANGELOG to Markdown Fix active tab test for branches page Fix merge requests feature tests Wait for ajax call in merge request unsubscribe test Fix 500 error when creating mileston from group page Fix 404 when group path has dot in the name Add the tech writers usernames in the doc_sytleguide doc Fix broken SCSS linter errors due to missing newlines Fix Hash syntax to work for both Ruby 2.1 and 2.3 Fix Spinach merge request diff failures remove ashley since she no longer works here Revert "Improve tabbing usability for sign in page" Don't use member properties in users_spec, and remove loading ref. Clean up stray Sign up ref. Back off the array spreading, bc poltergeist freaks out. Convert dispatcher to es6. Add exists to users routes and fix endpoint. ...
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/create_deployment_service_spec.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/services/create_deployment_service_spec.rb b/spec/services/create_deployment_service_spec.rb
index 343b4385bf2..5fe56e7725f 100644
--- a/spec/services/create_deployment_service_spec.rb
+++ b/spec/services/create_deployment_service_spec.rb
@@ -84,11 +84,22 @@ describe CreateDeploymentService, services: true do
expect(subject).to be_persisted
end
end
+
+ context 'when project was removed' do
+ let(:project) { nil }
+
+ it 'does not create deployment or environment' do
+ expect { subject }.not_to raise_error
+
+ expect(Environment.count).to be_zero
+ expect(Deployment.count).to be_zero
+ end
+ end
end
describe 'processing of builds' do
let(:environment) { nil }
-
+
shared_examples 'does not create environment and deployment' do
it 'does not create a new environment' do
expect { subject }.not_to change { Environment.count }
@@ -133,12 +144,12 @@ describe CreateDeploymentService, services: true do
context 'without environment specified' do
let(:build) { create(:ci_build, project: project) }
-
+
it_behaves_like 'does not create environment and deployment' do
subject { build.success }
end
end
-
+
context 'when environment is specified' do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline, environment: 'production', options: options) }