diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-06 10:52:55 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-06 10:54:27 +0900 |
commit | 5f47ebaa6c8e675637459649e541c3a48f174cb5 (patch) | |
tree | 90b5223f742a6bb24b99bc50385d453a34882076 /spec/workers | |
parent | b3020aaffd1d04319c1d9a06b73a3dd7d93514de (diff) | |
download | gitlab-ce-5f47ebaa6c8e675637459649e541c3a48f174cb5.tar.gz |
Create deployments only if action: start
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/build_success_worker_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/workers/build_success_worker_spec.rb b/spec/workers/build_success_worker_spec.rb index 8e9b178728e..5eb9709ded9 100644 --- a/spec/workers/build_success_worker_spec.rb +++ b/spec/workers/build_success_worker_spec.rb @@ -47,6 +47,19 @@ describe BuildSuccessWorker do expect(build.reload).not_to be_has_deployment end end + + context 'when the build will stop an environment' do + let!(:build) { create(:ci_build, :stop_review_app, environment: environment.name, project: environment.project) } + let(:environment) { create(:environment, state: :available) } + + it 'stops the environment' do + expect(environment).to be_available + + subject + + expect(environment.reload).to be_stopped + end + end end context 'when build does not exist' do |