diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-05 21:29:00 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-05 21:29:00 +0000 |
commit | 07d137a93afc43bfdc95f821a0f32bf07ff87e34 (patch) | |
tree | 1cc0ad5ea3abde80dbe8ba2709a57f30e50af456 /spec/models | |
parent | 91b1e9dc77eea57535e1f43c6f32d60d0ee34217 (diff) | |
parent | bd2ebeda84e4a36d58713c7d9314ad44ff6d89ed (diff) | |
download | gitlab-ce-07d137a93afc43bfdc95f821a0f32bf07ff87e34.tar.gz |
Merge branch 'use-deployment-relation-to-fetch-environment-ce' into 'master'
Backport: Optimize slow pipelines.js response
See merge request gitlab-org/gitlab-ce!24890
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/build_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 8a1bbb26e57..47865e4d08f 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1844,6 +1844,26 @@ describe Ci::Build do context 'when there is no environment' do it { is_expected.to be_nil } end + + context 'when build has a start environment' do + let(:build) { create(:ci_build, :deploy_to_production, pipeline: pipeline) } + + it 'does not expand environment name' do + expect(build).not_to receive(:expanded_environment_name) + + subject + end + end + + context 'when build has a stop environment' do + let(:build) { create(:ci_build, :stop_review_app, pipeline: pipeline) } + + it 'expands environment name' do + expect(build).to receive(:expanded_environment_name) + + subject + end + end end describe '#play' do |