Commit 3420c0f7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix post receive specs regarding pipeline creation

parent 9776dbda
...@@ -70,12 +70,15 @@ describe PostReceive do ...@@ -70,12 +70,15 @@ describe PostReceive do
context "creates a Ci::Pipeline for every change" do context "creates a Ci::Pipeline for every change" do
before 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 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 end
it { expect { subject }.to change { Ci::Pipeline.count }.by(2) } it { expect { subject }.to change { Ci::Pipeline.count }.by(2) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment