BigW Consortium Gitlab

Commit f2afdc92 by Lin Jen-Shin

Test if expanded_environment_name could expand var

parent 8607383e
......@@ -1306,11 +1306,25 @@ describe Ci::Build, models: true do
describe '#expanded_environment_name' do
subject { build.expanded_environment_name }
context 'when environment uses variables' do
let(:build) { create(:ci_build, ref: 'master', environment: 'review/$CI_BUILD_REF_NAME') }
context 'when environment uses $CI_BUILD_REF_NAME' do
let(:build) do
create(:ci_build,
ref: 'master',
environment: 'review/$CI_BUILD_REF_NAME')
end
it { is_expected.to eq('review/master') }
end
context 'when environment uses yaml_variables containing symbol keys' do
let(:build) do
create(:ci_build,
yaml_variables: [{key: :APP_HOST, value: 'host'}],
environment: 'review/$APP_HOST')
end
it { is_expected.to eq('review/host') }
end
end
describe '#detailed_status' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment