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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 03:07:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 03:07:52 +0300
commit4fe93274dec62ff7361a67be88e320131d66b788 (patch)
tree98ae79e3101ffd6569fc48bb4c7ad8808540ceb8 /spec/models/ci
parentbbaf2bb0438b1c71020d9d216feb528add225a7f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/build_spec.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 37219365ecf..757c158e16a 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1293,7 +1293,35 @@ describe Ci::Build do
environment: 'review/$APP_HOST')
end
- it { is_expected.to eq('review/host') }
+ it 'returns an expanded environment name with a list of variables' do
+ expect(build).to receive(:simple_variables).once.and_call_original
+
+ is_expected.to eq('review/host')
+ end
+
+ context 'when build metadata has already persisted the expanded environment name' do
+ before do
+ build.metadata.expanded_environment_name = 'review/host'
+ end
+
+ it 'returns a persisted expanded environment name without a list of variables' do
+ expect(build).not_to receive(:simple_variables)
+
+ is_expected.to eq('review/host')
+ end
+
+ context 'when ci_persisted_expanded_environment_name feature flag is disabled' do
+ before do
+ stub_feature_flags(ci_persisted_expanded_environment_name: false)
+ end
+
+ it 'returns an expanded environment name with a list of variables' do
+ expect(build).to receive(:simple_variables).once.and_call_original
+
+ is_expected.to eq('review/host')
+ end
+ end
+ end
end
context 'when using persisted variables' do