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/support/helpers/create_environments_helpers.rb')
-rw-r--r--spec/support/helpers/create_environments_helpers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/helpers/create_environments_helpers.rb b/spec/support/helpers/create_environments_helpers.rb
new file mode 100644
index 00000000000..be105f5862b
--- /dev/null
+++ b/spec/support/helpers/create_environments_helpers.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module CreateEnvironmentsHelpers
+ def create_review_app(user, project, ref)
+ common = { project: project, ref: ref, user: user }
+ pipeline = create(:ci_pipeline, **common)
+ start_review = create(:ci_build, :start_review_app, :success, **common, pipeline: pipeline)
+ stop_review = create(:ci_build, :stop_review_app, :manual, **common, pipeline: pipeline)
+ environment = create(:environment, :auto_stoppable, project: project, name: ref)
+ create(:deployment, :success, **common, on_stop: stop_review.name,
+ deployable: start_review, environment: environment)
+ end
+end