diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 21:09:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 21:09:38 +0000 |
commit | 232e0a31f1e5d5b3a788dfc3dba8f8d41df36bf9 (patch) | |
tree | a2b11b9a805ef1165d8730934ba4a4f801f31870 /spec/services/deployments | |
parent | 00fa950a34b1c94617110b150b8b2517d5241249 (diff) | |
download | gitlab-ce-232e0a31f1e5d5b3a788dfc3dba8f8d41df36bf9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/deployments')
-rw-r--r-- | spec/services/deployments/after_create_service_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/deployments/after_create_service_spec.rb b/spec/services/deployments/after_create_service_spec.rb index 3aa137a866e..5a69ffd8b9c 100644 --- a/spec/services/deployments/after_create_service_spec.rb +++ b/spec/services/deployments/after_create_service_spec.rb @@ -177,6 +177,26 @@ describe Deployments::AfterCreateService do it { is_expected.to eq('http://review/host') } end + context 'when job variables are generated during runtime' do + let(:job) do + create(:ci_build, + :with_deployment, + pipeline: pipeline, + environment: 'review/$CI_COMMIT_REF_NAME', + project: project, + job_variables: [job_variable], + options: { environment: { name: 'review/$CI_COMMIT_REF_NAME', url: 'http://$DYNAMIC_ENV_URL' } }) + end + + let(:job_variable) do + build(:ci_job_variable, :dotenv_source, key: 'DYNAMIC_ENV_URL', value: 'abc.test.com') + end + + it 'expands the environment URL from the dynamic variable' do + is_expected.to eq('http://abc.test.com') + end + end + context 'when yaml environment does not have url' do let(:job) { create(:ci_build, :with_deployment, pipeline: pipeline, environment: 'staging', project: project) } |