gitlab-org--gitlab-foss/spec/factories/ci/pipelines.rb

34 lines
963 B
Ruby
Raw Normal View History

2015-08-26 01:42:46 +00:00
FactoryGirl.define do
factory :ci_empty_pipeline, class: Ci::Pipeline do
ref 'master'
2015-08-26 01:42:46 +00:00
sha '97de212e80737a608d939f648d959671fb0a0142'
status 'pending'
2015-08-26 01:42:46 +00:00
2015-12-04 11:55:23 +00:00
project factory: :empty_project
2015-09-28 11:14:34 +00:00
factory :ci_pipeline_without_jobs do
2015-10-05 10:02:26 +00:00
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) }
2015-08-26 01:42:46 +00:00
end
end
factory :ci_pipeline_with_one_job do
2015-10-05 10:02:26 +00:00
after(:build) do |commit|
2015-10-05 12:39:56 +00:00
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) }
2015-08-26 01:42:46 +00:00
end
end
factory :ci_pipeline_with_two_job do
2015-10-05 10:02:26 +00:00
after(:build) do |commit|
2015-10-05 12:39:56 +00:00
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) }
2015-10-05 10:02:26 +00:00
end
end
factory :ci_pipeline do
2015-10-05 10:02:26 +00:00
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
2015-08-26 01:42:46 +00:00
end
end
end
end