diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-06 15:19:52 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-06 17:15:15 +0200 |
commit | 6c0fc62ef5c4fa4535174a9f187b9853f0fb90ac (patch) | |
tree | 0db34e09c24d3b98baa48e4db6ac27e0b4324871 /spec/factories/environments.rb | |
parent | e533d43a8c03a9b47a7016f3fea01a00ca797778 (diff) | |
download | gitlab-ce-6c0fc62ef5c4fa4535174a9f187b9853f0fb90ac.tar.gz |
Take branch access into account when stopping environment
Diffstat (limited to 'spec/factories/environments.rb')
-rw-r--r-- | spec/factories/environments.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/factories/environments.rb b/spec/factories/environments.rb index f6595751d1e..d8d699fb3aa 100644 --- a/spec/factories/environments.rb +++ b/spec/factories/environments.rb @@ -20,14 +20,18 @@ FactoryGirl.define do after(:create) do |environment, evaluator| pipeline = create(:ci_pipeline, project: environment.project) + deployable = create(:ci_build, name: "#{environment.name}:deploy", + pipeline: pipeline) + deployment = create(:deployment, environment: environment, project: environment.project, + deployable: deployable, ref: evaluator.ref, sha: environment.project.commit(evaluator.ref).id) teardown_build = create(:ci_build, :manual, - name: "#{deployment.environment.name}:teardown", + name: "#{environment.name}:teardown", pipeline: pipeline) deployment.update_column(:on_stop, teardown_build.name) |