diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 03:09:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 03:09:07 +0300 |
commit | e144369009f3404072f7e0f969f7cded93195a01 (patch) | |
tree | d7a354e2c3c69a7ad65dc81aba8fe2ba59b0a26f /spec/support/helpers | |
parent | d466ee5042520ad078fe050cb078d81dc2ebe196 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/create_environments_helpers.rb | 13 |
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 |