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:
Diffstat (limited to 'spec/factories/environments.rb')
-rw-r--r--spec/factories/environments.rb27
1 files changed, 13 insertions, 14 deletions
diff --git a/spec/factories/environments.rb b/spec/factories/environments.rb
index 34843dab0fe..2df9f482bb9 100644
--- a/spec/factories/environments.rb
+++ b/spec/factories/environments.rb
@@ -46,20 +46,19 @@ FactoryBot.define do
after(:create) do |environment, evaluator|
pipeline = create(:ci_pipeline, project: environment.project)
- deployable = create(:ci_build, :success, name: "#{environment.name}:deploy",
- pipeline: pipeline)
-
- deployment = create(:deployment,
- :success,
- environment: environment,
- project: environment.project,
- deployable: deployable,
- ref: evaluator.ref,
- sha: environment.project.commit(evaluator.ref).id)
-
- teardown_build = create(:ci_build, :manual,
- name: "#{environment.name}:teardown",
- pipeline: pipeline)
+ deployable = create(:ci_build, :success, name: "#{environment.name}:deploy", pipeline: pipeline)
+
+ deployment = create(
+ :deployment,
+ :success,
+ environment: environment,
+ project: environment.project,
+ deployable: deployable,
+ ref: evaluator.ref,
+ sha: environment.project.commit(evaluator.ref).id
+ )
+
+ teardown_build = create(:ci_build, :manual, name: "#{environment.name}:teardown", pipeline: pipeline)
deployment.update_column(:on_stop, teardown_build.name)
environment.update_attribute(:deployments, [deployment])