summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-25 15:15:31 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-25 15:15:31 +0100
commit86e7f22b6d10b9113c52f79685edb332d202f567 (patch)
tree1a4b4b27ae088cf42d26b5af419569c4a8a518a1 /spec/factories
parentd766ab9f9a72a2919fb20c27fdf7b74e88042340 (diff)
downloadgitlab-ce-86e7f22b6d10b9113c52f79685edb332d202f567.tar.gz
Improve readability in pipeline test objects factory
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/ci/pipelines.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb
index 4fd29806590..23585db6ebd 100644
--- a/spec/factories/ci/pipelines.rb
+++ b/spec/factories/ci/pipelines.rb
@@ -7,20 +7,24 @@ FactoryGirl.define do
project factory: :empty_project
factory :ci_pipeline_without_jobs do
- after(:build) do |commit|
- allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) }
+ after(:build) do |pipeline|
+ allow(pipeline).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" } }) }
+ after(:build) do |pipeline|
+ allow(pipeline).to receive(:ci_yaml_file) do
+ YAML.dump({ rspec: { script: "ls" } })
+ end
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')) }
+ after(:build) do |pipeline|
+ allow(pipeline).to receive(:ci_yaml_file) do
+ File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
+ end
end
end