pact_broker 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +2 -0
- data/RELEASING.md +1 -0
- data/config.ru +1 -1
- data/lib/pact_broker/domain/webhook_request.rb +7 -1
- data/lib/pact_broker/version.rb +1 -1
- data/spec/lib/pact_broker/domain/webhook_request_spec.rb +32 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e789a7f93e0c406d9a7fddda930d8a226098aa
|
4
|
+
data.tar.gz: 17f764538b78147ee4c2a7fe7546e799b58bd98e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786b010b045b1b380f67eceeb0e5a0dbf4689d3daeb52a1445cd9d0cbca7462ce1a219fc39fd47d17da41c631e479690be99f2be051a49fff1d5aa8ab22a8caa
|
7
|
+
data.tar.gz: 2d6b77c90a5ac7d27b7034dd065ebc7dc8005ec4f008010c75434e73ce93d687416238fd17a8971bfd18b439813208516f0b1a26e4d6ebae116fcbc7253ae7e8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,8 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
$ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
4
4
|
|
5
|
+
#### 1.11.1 (2016-10-13)
|
6
|
+
* 14381ac - Fix issue #59 Error when executing web hook with body. (Beth Skurrie, Thu Oct 13 12:50:17 2016 +1100)
|
5
7
|
|
6
8
|
#### 1.11.0 (2016-08-13)
|
7
9
|
* 18ffc4a - Add conflict guards to pact merger (Steve Pletcher, Fri Aug 5 12:31:30 2016 -0400)
|
data/RELEASING.md
CHANGED
data/config.ru
CHANGED
@@ -5,7 +5,7 @@ require 'rack/hal_browser'
|
|
5
5
|
require 'pact_broker/ui/controllers/relationships'
|
6
6
|
|
7
7
|
|
8
|
-
use Rack::Static, :urls => ["/stylesheets", "/css", "/fonts", "/js", "/javascripts"], :root => "public"
|
8
|
+
use Rack::Static, :urls => ["/stylesheets", "/css", "/fonts", "/js", "/javascripts", "/images"], :root => "public"
|
9
9
|
use Rack::HalBrowser::Redirect, :exclude => ['/diagnostic', '/trace','/index']
|
10
10
|
|
11
11
|
run Rack::URLMap.new(
|
@@ -56,7 +56,13 @@ module PactBroker
|
|
56
56
|
|
57
57
|
req.basic_auth(username, password) if username
|
58
58
|
|
59
|
-
|
59
|
+
unless body.nil?
|
60
|
+
if String === body
|
61
|
+
req.body = body
|
62
|
+
else
|
63
|
+
req.body = body.to_json
|
64
|
+
end
|
65
|
+
end
|
60
66
|
|
61
67
|
logger.info "Making webhook request #{to_s}"
|
62
68
|
response = Net::HTTP.start(uri.hostname, uri.port,
|
data/lib/pact_broker/version.rb
CHANGED
@@ -11,6 +11,7 @@ module PactBroker
|
|
11
11
|
let(:username) { nil }
|
12
12
|
let(:password) { nil }
|
13
13
|
let(:url) { 'http://example.org/hook' }
|
14
|
+
let(:body) { 'body' }
|
14
15
|
|
15
16
|
subject do
|
16
17
|
WebhookRequest.new(
|
@@ -19,7 +20,7 @@ module PactBroker
|
|
19
20
|
headers: {'Content-type' => 'text/plain'},
|
20
21
|
username: username,
|
21
22
|
password: password,
|
22
|
-
body:
|
23
|
+
body: body)
|
23
24
|
end
|
24
25
|
|
25
26
|
describe "description" do
|
@@ -103,6 +104,36 @@ module PactBroker
|
|
103
104
|
end
|
104
105
|
end
|
105
106
|
|
107
|
+
context "when the request has a JSONable body" do
|
108
|
+
let(:body) { [{"some": "json"}] }
|
109
|
+
|
110
|
+
let!(:http_request) do
|
111
|
+
stub_request(:post, "http://example.org/hook").
|
112
|
+
with(:headers => {'Content-Type'=>'text/plain'}, :body => body.to_json).
|
113
|
+
to_return(:status => 302, :body => "respbod", :headers => {'Content-Type' => 'text/plain, blah'})
|
114
|
+
end
|
115
|
+
|
116
|
+
it "converts the body to JSON before submitting the request" do
|
117
|
+
subject.execute
|
118
|
+
expect(http_request).to have_been_made
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
context "when the request has a nil body" do
|
123
|
+
let(:body) { nil }
|
124
|
+
|
125
|
+
let!(:http_request) do
|
126
|
+
stub_request(:post, "http://example.org/hook").
|
127
|
+
with(:headers => {'Content-Type'=>'text/plain'}, :body => nil).
|
128
|
+
to_return(:status => 302, :body => "respbod", :headers => {'Content-Type' => 'text/plain, blah'})
|
129
|
+
end
|
130
|
+
|
131
|
+
it "executes the request without a body" do
|
132
|
+
subject.execute
|
133
|
+
expect(http_request).to have_been_made
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
106
137
|
context "when the request is successful" do
|
107
138
|
it "returns a WebhookExecutionResult with success=true" do
|
108
139
|
expect(subject.execute.success?).to be true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|