2015-08-25 21:42:46 -04:00
|
|
|
FactoryGirl.define do
|
2016-06-03 10:22:26 -04:00
|
|
|
factory :ci_empty_pipeline, class: Ci::Pipeline do
|
2016-08-11 09:22:35 -04:00
|
|
|
ref 'master'
|
2015-08-25 21:42:46 -04:00
|
|
|
sha '97de212e80737a608d939f648d959671fb0a0142'
|
2016-08-11 09:22:35 -04:00
|
|
|
status 'pending'
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2015-12-04 06:55:23 -05:00
|
|
|
project factory: :empty_project
|
2015-09-28 07:14:34 -04:00
|
|
|
|
2016-06-03 10:22:26 -04:00
|
|
|
factory :ci_pipeline_without_jobs do
|
2015-10-05 06:02:26 -04:00
|
|
|
after(:build) do |commit|
|
2015-10-05 04:14:33 -04:00
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) }
|
2015-08-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-03 10:22:26 -04:00
|
|
|
factory :ci_pipeline_with_one_job do
|
2015-10-05 06:02:26 -04:00
|
|
|
after(:build) do |commit|
|
2015-10-05 08:39:56 -04:00
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) }
|
2015-08-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-03 10:22:26 -04:00
|
|
|
factory :ci_pipeline_with_two_job do
|
2015-10-05 06:02:26 -04:00
|
|
|
after(:build) do |commit|
|
2015-10-05 08:39:56 -04:00
|
|
|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) }
|
2015-10-05 06:02:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-03 10:22:26 -04:00
|
|
|
factory :ci_pipeline do
|
2015-10-05 06:02:26 -04: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-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|