summaryrefslogtreecommitdiff
path: root/spec/factories/environments.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-14 14:10:54 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-14 14:10:54 +0100
commitceb06983ec186bcc1c6fce28613bdb92297e5bf1 (patch)
tree5f916ed102a5c91fae7a0bf5620f633c087acc68 /spec/factories/environments.rb
parent990765edf354a7bbb39d3897780fb85bf8d6fa48 (diff)
downloadgitlab-ce-ceb06983ec186bcc1c6fce28613bdb92297e5bf1.tar.gz
Make it possible to fabricate environment on branch
Diffstat (limited to 'spec/factories/environments.rb')
-rw-r--r--spec/factories/environments.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/factories/environments.rb b/spec/factories/environments.rb
index bb6558a403f..0852dda6b29 100644
--- a/spec/factories/environments.rb
+++ b/spec/factories/environments.rb
@@ -8,16 +8,21 @@ FactoryGirl.define do
trait :with_review_app do |environment|
project
+ transient do
+ ref 'master'
+ end
+
# At this point `review app` is an ephemeral concept related to
# deployments being deployed for given environment. There is no
# first-class `review app` available so we need to create set of
# interconnected objects to simulate a review app.
#
- after(:create) do |environment|
+ after(:create) do |environment, evaluator|
deployment = create(:deployment,
environment: environment,
project: environment.project,
- sha: environment.project.commit.id)
+ ref: evaluator.ref,
+ sha: environment.project.commit(evaluator.ref).id)
teardown_build = create(:ci_build, :manual,
name: "#{deployment.environment.name}:teardown",