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:
authorLin Jen-Shin <godfat@godfat.org>2017-06-21 15:22:26 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-06-21 15:22:26 +0300
commit98b60ee29ba99ec28f4c4782a76f52d675eaf083 (patch)
tree559ac3fe247f43356dce7db6f23d932dff16d49e /spec/services/create_deployment_service_spec.rb
parent0d3631acc16b5046ef295bf09204a565cb8580ea (diff)
Expand with all the variables so that things like
CI_ENVIRONMENT_SLUG is also available. It won't be recursive because we're not putting this value in the variables.
Diffstat (limited to 'spec/services/create_deployment_service_spec.rb')
-rw-r--r--spec/services/create_deployment_service_spec.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/services/create_deployment_service_spec.rb b/spec/services/create_deployment_service_spec.rb
index 790713cf2e4..dfab6ebf372 100644
--- a/spec/services/create_deployment_service_spec.rb
+++ b/spec/services/create_deployment_service_spec.rb
@@ -135,6 +135,25 @@ describe CreateDeploymentService, services: true do
it { is_expected.to eq('http://review/master') }
end
+ context 'when yaml environment uses $CI_ENVIRONMENT_SLUG' do
+ let(:job) do
+ create(:ci_build,
+ ref: 'master',
+ environment: 'production',
+ options: { environment: { url: 'http://review/$CI_ENVIRONMENT_SLUG' } })
+ end
+
+ let!(:environment) do
+ create(:environment,
+ project: job.project,
+ name: 'production',
+ slug: 'prod-slug',
+ external_url: 'http://review/old')
+ end
+
+ it { is_expected.to eq('http://review/prod-slug') }
+ end
+
context 'when yaml environment uses yaml_variables containing symbol keys' do
let(:job) do
create(:ci_build,
@@ -153,7 +172,7 @@ describe CreateDeploymentService, services: true do
end
it 'returns the external_url from persisted environment' do
- is_expected.to eq(environment.external_url)
+ is_expected.to be_nil
end
end
end