diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-25 15:15:31 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-25 15:15:31 +0100 |
commit | 86e7f22b6d10b9113c52f79685edb332d202f567 (patch) | |
tree | 1a4b4b27ae088cf42d26b5af419569c4a8a518a1 /spec/factories | |
parent | d766ab9f9a72a2919fb20c27fdf7b74e88042340 (diff) | |
download | gitlab-ce-86e7f22b6d10b9113c52f79685edb332d202f567.tar.gz |
Improve readability in pipeline test objects factory
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/pipelines.rb | 16 |
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 |