gitlab-org--gitlab-foss/spec/factories/deployments.rb

20 lines
500 B
Ruby
Raw Normal View History

2016-06-14 07:51:12 -04:00
FactoryGirl.define do
factory :deployment, class: Deployment do
sha '97de212e80737a608d939f648d959671fb0a0142'
ref 'master'
2016-06-15 06:03:49 -04:00
tag false
user
project nil
deployable factory: :ci_build
2016-06-14 07:51:12 -04:00
environment factory: :environment
after(:build) do |deployment, evaluator|
deployment.project ||= deployment.environment.project
unless deployment.project.repository_exists?
allow(deployment.project.repository).to receive(:create_ref)
end
2016-06-14 07:51:12 -04:00
end
end
end