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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 16:19:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 18:15:15 +0300
commit6c0fc62ef5c4fa4535174a9f187b9853f0fb90ac (patch)
tree0db34e09c24d3b98baa48e4db6ac27e0b4324871 /spec/factories
parente533d43a8c03a9b47a7016f3fea01a00ca797778 (diff)
Take branch access into account when stopping environment
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/environments.rb6
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)