Define utility functions later, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13581143
This commit is contained in:
parent
584258dbb8
commit
a92dd54495
|
@ -562,16 +562,6 @@ describe Ci::Pipeline, models: true do
|
|||
end
|
||||
|
||||
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_b) { create_build('b') }
|
||||
|
||||
|
@ -587,6 +577,16 @@ describe Ci::Pipeline, models: true do
|
|||
expect(WebMock).to requested(status)
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue