diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-02 15:19:34 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-02 15:19:34 +0800 |
commit | 3731ae092cac523a0092c64000d9e838662a85df (patch) | |
tree | d8449d24ff6da3bee4b42f134ac542bf2303bb6a /spec/models | |
parent | b01bc0a0362fdc81f61941bee3b090267b6873c1 (diff) | |
download | gitlab-ce-3731ae092cac523a0092c64000d9e838662a85df.tar.gz |
CreatePipelineBuildsService would have created env
So we don't have to do it in CreateDeploymentService
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11695#note_31322649
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/build_spec.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 2ad7f27ffac..22ee469dd86 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -960,36 +960,6 @@ describe Ci::Build, :models do end end - describe '#ensure_persisted_environment' do - subject { job.ensure_persisted_environment } - - let(:job) do - create(:ci_build, - ref: 'master', - environment: 'staging/$CI_COMMIT_REF_NAME') - end - - context 'when there is no environment' do - it 'creates one by the expanded name' do - expect do - expect(subject.name).to eq('staging/master') - end.to change { Environment.count }.by(1) - end - end - - context 'when there is already an environment' do - let!(:environment) do - create(:environment, project: job.project, name: 'staging/master') - end - - it 'returns the existing environment' do - expect do - expect(subject).to eq(environment) - end.to change { Environment.count }.by(0) - end - end - end - describe '#play' do let(:build) { create(:ci_build, :manual, pipeline: pipeline) } |