diff options
Diffstat (limited to 'spec/factories/ci/pipelines.rb')
-rw-r--r-- | spec/factories/ci/pipelines.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |