summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-05 00:44:17 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-05 00:44:17 +0800
commita92dd5449524780c2a56e9627059b6c0e2362805 (patch)
tree7ff66c3c2c634c1ce9521c247e5f8c3fb8dd22f6 /spec
parent584258dbb82f76c627d8552fc96689c7879b36f6 (diff)
downloadgitlab-ce-a92dd5449524780c2a56e9627059b6c0e2362805.tar.gz
Define utility functions later, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13581143
Diffstat (limited to 'spec')
-rw-r--r--spec/models/ci/pipeline_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index f45684414e6..542264eb1d9 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -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