Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-07-15 17:17:46 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-07-16 12:50:59 +0300
commit72818f2c1573b7664d4b41692dc51db1e5c28fbb (patch)
treead691134ff26ac1cb2e5335571c3f50ed9286897 /spec/services/create_deployment_service_spec.rb
parent2550c1c2bc70beb14293eebb243a2f6f3039d04b (diff)
Fix creation of deployment on build that is retried, redeployed or rollback
Diffstat (limited to 'spec/services/create_deployment_service_spec.rb')
-rw-r--r--spec/services/create_deployment_service_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/create_deployment_service_spec.rb b/spec/services/create_deployment_service_spec.rb
index 654e441f3cd..8da2a2b3c1b 100644
--- a/spec/services/create_deployment_service_spec.rb
+++ b/spec/services/create_deployment_service_spec.rb
@@ -89,6 +89,12 @@ describe CreateDeploymentService, services: true do
expect_any_instance_of(described_class).to receive(:execute)
subject
end
+
+ it 'is set as deployable' do
+ subject
+
+ expect(Deployment.last.deployable).to eq(deployable)
+ end
end
context 'without environment specified' do
@@ -105,6 +111,8 @@ describe CreateDeploymentService, services: true do
context 'when build succeeds' do
it_behaves_like 'does create environment and deployment' do
+ let(:deployable) { build }
+
subject { build.success }
end
end
@@ -114,6 +122,14 @@ describe CreateDeploymentService, services: true do
subject { build.drop }
end
end
+
+ context 'when build is retried' do
+ it_behaves_like 'does create environment and deployment' do
+ let(:deployable) { Ci::Build.retry(build) }
+
+ subject { deployable.success }
+ end
+ end
end
end
end