Welcome to mirror list, hosted at ThFree Co, Russian Federation.

create_environments_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: be105f5862b4e7121e723f0d186aa034b54d27cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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