diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-26 09:36:45 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-26 09:36:45 +0200 |
commit | 3420c0f7dc7e9f11ec94a1b35b93ce7adba75bd1 (patch) | |
tree | 7f3efa163b3ae5ea97d93d71458b32d2493189e8 /spec/workers | |
parent | 9776dbda4f6d8f0f7e9a32185cc0d493f9fe3c02 (diff) | |
download | gitlab-ce-3420c0f7dc7e9f11ec94a1b35b93ce7adba75bd1.tar.gz |
Fix post receive specs regarding pipeline creation
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/post_receive_spec.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index d3707a3cc11..05eecf5f0bb 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -70,12 +70,15 @@ describe PostReceive do context "creates a Ci::Pipeline for every change" do before do - allow_any_instance_of(Ci::CreatePipelineService).to receive(:commit) do - OpenStruct.new(id: '123456') - end - allow_any_instance_of(Ci::CreatePipelineService).to receive(:branch?).and_return(true) - allow_any_instance_of(Repository).to receive(:ref_exists?).and_return(true) stub_ci_pipeline_to_return_yaml_file + + # TODO, don't stub private methods + # + allow_any_instance_of(Ci::CreatePipelineService) + .to receive(:commit).and_return(OpenStruct.new(id: '123456')) + + allow_any_instance_of(Repository) + .to receive(:branch_exists?).and_return(true) end it { expect { subject }.to change { Ci::Pipeline.count }.by(2) } |