diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-14 14:10:54 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-14 14:10:54 +0100 |
commit | ceb06983ec186bcc1c6fce28613bdb92297e5bf1 (patch) | |
tree | 5f916ed102a5c91fae7a0bf5620f633c087acc68 /spec/factories/environments.rb | |
parent | 990765edf354a7bbb39d3897780fb85bf8d6fa48 (diff) | |
download | gitlab-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.rb | 9 |
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", |