summaryrefslogtreecommitdiff
path: root/spec/services/create_deployment_service_spec.rb
diff options
context:
space:
mode:
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