From cd3f112f88c2362bb64961e52e6272314287a80b Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 15 Jun 2016 17:34:44 +0800 Subject: Adopt the rename from ci_commits to ci_pipelines --- spec/factories/ci/commits.rb | 49 ------------------------------------------ spec/factories/ci/pipelines.rb | 49 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 spec/factories/ci/commits.rb create mode 100644 spec/factories/ci/pipelines.rb (limited to 'spec/factories/ci') diff --git a/spec/factories/ci/commits.rb b/spec/factories/ci/commits.rb deleted file mode 100644 index a039bef6f3c..00000000000 --- a/spec/factories/ci/commits.rb +++ /dev/null @@ -1,49 +0,0 @@ -# == Schema Information -# -# Table name: commits -# -# id :integer not null, primary key -# project_id :integer -# ref :string(255) -# sha :string(255) -# before_sha :string(255) -# push_data :text -# created_at :datetime -# updated_at :datetime -# tag :boolean default(FALSE) -# yaml_errors :text -# committed_at :datetime -# gl_project_id :integer -# - -FactoryGirl.define do - factory :ci_empty_pipeline, class: Ci::Pipeline do - sha '97de212e80737a608d939f648d959671fb0a0142' - - project factory: :empty_project - - factory :ci_pipeline_without_jobs do - after(:build) do |commit| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) } - end - end - - factory :ci_pipeline_with_one_job do - after(:build) do |commit| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) } - end - end - - factory :ci_pipeline_with_two_job do - after(:build) do |commit| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) } - end - end - - factory :ci_pipeline do - after(:build) do |commit| - allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } - end - end - end -end diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb new file mode 100644 index 00000000000..a039bef6f3c --- /dev/null +++ b/spec/factories/ci/pipelines.rb @@ -0,0 +1,49 @@ +# == Schema Information +# +# Table name: commits +# +# id :integer not null, primary key +# project_id :integer +# ref :string(255) +# sha :string(255) +# before_sha :string(255) +# push_data :text +# created_at :datetime +# updated_at :datetime +# tag :boolean default(FALSE) +# yaml_errors :text +# committed_at :datetime +# gl_project_id :integer +# + +FactoryGirl.define do + factory :ci_empty_pipeline, class: Ci::Pipeline do + sha '97de212e80737a608d939f648d959671fb0a0142' + + project factory: :empty_project + + factory :ci_pipeline_without_jobs do + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) } + end + end + + factory :ci_pipeline_with_one_job do + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) } + end + end + + factory :ci_pipeline_with_two_job do + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) } + end + end + + factory :ci_pipeline do + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } + end + end + end +end -- cgit v1.2.3