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

21 lines
556 B
Ruby
Raw Normal View History

FactoryBot.define do
2016-06-14 07:51:12 -04:00
factory :deployment, class: Deployment do
sha '97de212e80737a608d939f648d959671fb0a0142'
ref 'master'
2016-06-15 06:03:49 -04:00
tag false
user nil
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
deployment.user ||= deployment.project.creator
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