diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 12:02:26 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 12:02:26 +0200 |
commit | 317a7469545d0e9a70e54a87a540b8aabe4c418b (patch) | |
tree | 34d0d41cc2518cddb098660f0f12112ab927f667 /spec/factories | |
parent | e3d870d7fc282a1f0a1028996c8b44e5d32b9cbf (diff) | |
download | gitlab-ce-317a7469545d0e9a70e54a87a540b8aabe4c418b.tar.gz |
Make commit_spec run
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/commits.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/factories/ci/commits.rb b/spec/factories/ci/commits.rb index b74aae795aa..9226e04a7b3 100644 --- a/spec/factories/ci/commits.rb +++ b/spec/factories/ci/commits.rb @@ -23,20 +23,26 @@ FactoryGirl.define do gl_project factory: :empty_project factory :ci_commit_without_jobs do - after(:create) do |commit, evaluator| + after(:build) do |commit| allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) } end end factory :ci_commit_with_one_job do - after(:create) do |commit, evaluator| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) } + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { YAML.dump({rspec: {script: "ls"}}) } end end factory :ci_commit_with_two_jobs do - after(:create) do |commit, evaluator| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) } + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { YAML.dump({rspec: {script: "ls"}, spinach: {script: "ls"}}) } + end + end + + factory :ci_commit_yaml_stub do + after(:build) do |commit| + allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } end end end |