From 4e516dbff9767a35677fdc4a6e39005b4b564376 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 13 Nov 2019 12:06:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/factories/ci/pipelines.rb | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'spec/factories/ci') diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index 39ab574cc76..e2ec9d496bc 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true FactoryBot.define do + # TODO: we can remove this factory in favour of :ci_pipeline factory :ci_empty_pipeline, class: Ci::Pipeline do source { :push } ref { 'master' } @@ -10,20 +11,6 @@ FactoryBot.define do project - factory :ci_pipeline_without_jobs do - after(:build) do |pipeline| - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump({})) - end - end - - factory :ci_pipeline_with_one_job do - after(:build) do |pipeline| - allow(pipeline).to receive(:ci_yaml_file) do - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump({ rspec: { script: "ls" } })) - end - end - end - # Persist merge request head_pipeline_id # on pipeline factories to avoid circular references transient { head_pipeline_of { nil } } @@ -34,24 +21,8 @@ FactoryBot.define do end factory :ci_pipeline do - transient { config { nil } } - - after(:build) do |pipeline, evaluator| - if evaluator.config - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump(evaluator.config)) - - # Populates pipeline with errors - pipeline.config_processor if evaluator.config - else - pipeline.instance_variable_set(:@ci_yaml_file, File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))) - end - end - trait :invalid do - config do - { rspec: nil } - end - + yaml_errors { 'invalid YAML' } failure_reason { :config_error } end -- cgit v1.2.1