2015-09-25 12:07:36 +05:30
|
|
|
FactoryGirl.define do
|
2016-06-16 23:09:34 +05:30
|
|
|
factory :ci_empty_pipeline, class: Ci::Pipeline do
|
2016-09-13 17:45:13 +05:30
|
|
|
ref 'master'
|
2015-09-25 12:07:36 +05:30
|
|
|
sha '97de212e80737a608d939f648d959671fb0a0142'
|
2016-09-13 17:45:13 +05:30
|
|
|
status 'pending'
|
2015-10-24 18:46:33 +05:30
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
project factory: :empty_project
|
2015-09-25 12:07:36 +05:30
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
factory :ci_pipeline_without_jobs do
|
2015-10-24 18:46:33 +05:30
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) }
|
2015-09-25 12:07:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
factory :ci_pipeline_with_one_job do
|
2015-10-24 18:46:33 +05:30
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) }
|
2015-09-25 12:07:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
factory :ci_pipeline_with_two_job do
|
2015-10-24 18:46:33 +05:30
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
factory :ci_pipeline do
|
2015-10-24 18:46:33 +05:30
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
|
2015-09-25 12:07:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|