2016-06-14 11:51:12 +00:00
|
|
|
FactoryGirl.define do
|
|
|
|
factory :deployment, class: Deployment do
|
|
|
|
sha '97de212e80737a608d939f648d959671fb0a0142'
|
|
|
|
ref 'master'
|
2016-06-15 10:03:49 +00:00
|
|
|
tag false
|
2016-11-09 08:42:09 +00:00
|
|
|
user
|
2016-09-20 04:24:42 +00:00
|
|
|
project nil
|
2016-11-09 08:42:09 +00:00
|
|
|
deployable factory: :ci_build
|
2016-06-14 11:51:12 +00:00
|
|
|
environment factory: :environment
|
|
|
|
|
|
|
|
after(:build) do |deployment, evaluator|
|
2016-09-20 04:24:42 +00:00
|
|
|
deployment.project ||= deployment.environment.project
|
2017-08-09 13:41:45 +00:00
|
|
|
|
|
|
|
unless deployment.project.repository_exists?
|
|
|
|
allow(deployment.project.repository).to receive(:fetch_ref)
|
|
|
|
end
|
2016-06-14 11:51:12 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|