BigW Consortium Gitlab

Commit a92dd544 by Lin Jen-Shin
parent 584258db
...@@ -562,16 +562,6 @@ describe Ci::Pipeline, models: true do ...@@ -562,16 +562,6 @@ describe Ci::Pipeline, models: true do
end end
context 'with multiple builds' do context 'with multiple builds' do
def create_build(name)
create(:ci_build, :pending, pipeline: pipeline, name: name)
end
def requested(status)
have_requested(:post, hook.url).with do |req|
JSON.parse(req.body)['object_attributes']['status'] == status
end.once
end
let(:build_a) { create_build('a') } let(:build_a) { create_build('a') }
let(:build_b) { create_build('b') } let(:build_b) { create_build('b') }
...@@ -587,6 +577,16 @@ describe Ci::Pipeline, models: true do ...@@ -587,6 +577,16 @@ describe Ci::Pipeline, models: true do
expect(WebMock).to requested(status) expect(WebMock).to requested(status)
end end
end end
def create_build(name)
create(:ci_build, :pending, pipeline: pipeline, name: name)
end
def requested(status)
have_requested(:post, hook.url).with do |req|
JSON.parse(req.body)['object_attributes']['status'] == status
end.once
end
end end
end end
......
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