Define utility functions later, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13581143
This commit is contained in:
Lin Jen-Shin 2016-08-05 00:44:17 +08:00
parent 584258dbb8
commit a92dd54495
1 changed files with 10 additions and 10 deletions

View File

@ -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