summaryrefslogtreecommitdiff
path: root/spec/factories/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-25 15:11:56 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-25 15:11:56 +0100
commite1285c1d8ad2c7a5ed556bd5296fbe4afcacb16d (patch)
tree6e1595e7774e1fc8a8782e92e58b0bed20ffc895 /spec/factories/ci
parent94100d4e722ad61fec3e8ab3f9889ffabba1100f (diff)
downloadgitlab-ce-e1285c1d8ad2c7a5ed556bd5296fbe4afcacb16d.tar.gz
Restore method that ensures builds being created
Diffstat (limited to 'spec/factories/ci')
-rw-r--r--spec/factories/ci/pipelines.rb11
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