From e1285c1d8ad2c7a5ed556bd5296fbe4afcacb16d Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 25 Nov 2016 15:11:56 +0100 Subject: Restore method that ensures builds being created --- spec/factories/ci/pipelines.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/factories/ci') diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index ac2a1ba5dff..3c35dae8772 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -29,5 +29,16 @@ FactoryGirl.define do allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } end end + + factory(:ci_pipeline_with_yaml) do + transient { yaml nil } + + after(:build) do |pipeline, evaluator| + raise ArgumentError unless evaluator.yaml + + allow(pipeline).to receive(:ci_yaml_file) + .and_return(YAML.dump(evaluator.yaml)) + end + end end end -- cgit v1.2.3