bookingsync-api 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c4e6cd8678c43838cd16404afda232617573958
|
4
|
+
data.tar.gz: 4bef59232d6e3937eb82633008fe4c659e58a5a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1997f3fcebc513384f814f11971d263e7e502bcd109960ec430687f39203e1d79c1c7e21130a861dee06b29508d4e74340850408fe6d0636bd0e2f0ca927f4ba
|
7
|
+
data.tar.gz: 78a07d18490c529546f4e43c03bf7092599a19838fa47482e524e5043105f3a33b3238718fc305339d159bd3ef97bdaf6e481ccafea377c621f3e87a3a8af456
|
@@ -19,10 +19,11 @@ module BookingSync::API::Middleware
|
|
19
19
|
def_delegators :@logger, :debug, :info, :warn, :error, :fatal
|
20
20
|
|
21
21
|
def call(env)
|
22
|
-
info "#{env.method.upcase} #{env.url.to_s}"
|
22
|
+
info "Request #{env.method.upcase} #{env.url.to_s}"
|
23
23
|
debug('Request headers') { dump_headers env.request_headers }
|
24
24
|
debug('Request body') { dump_body env.body }
|
25
25
|
@app.call(env).tap do |response|
|
26
|
+
info "Response X-Request-Id: #{env.response_headers['X-Request-Id']} #{env.method.upcase} #{env.url.to_s}"
|
26
27
|
debug('Response headers') { dump_headers response.env.response_headers }
|
27
28
|
debug('Response status') { response.env.status }
|
28
29
|
debug('Response body') { dump_body response.env.body }
|
@@ -224,8 +224,21 @@ describe BookingSync::API::Client do
|
|
224
224
|
expect(Logger).to receive(:new).with(STDOUT).and_return(logger)
|
225
225
|
stub_get("resources")
|
226
226
|
client.get("resources")
|
227
|
+
|
228
|
+
messages = log.rewind && log.read
|
229
|
+
expect(messages).to include("GET https://www.bookingsync.com/api/v3/resources")
|
227
230
|
end
|
228
231
|
end
|
232
|
+
|
233
|
+
it "logs X-Request-Id from headers" do
|
234
|
+
client = BookingSync::API::Client.new(test_access_token, logger: logger)
|
235
|
+
stub_get("resources", body: {}.to_json,
|
236
|
+
headers: {'X-Request-Id' => "021bfb82"})
|
237
|
+
client.get("resources")
|
238
|
+
|
239
|
+
messages = log.rewind && log.read
|
240
|
+
expect(messages).to include("Response X-Request-Id: 021bfb82 GET https://www.bookingsync.com/api/v3/resources")
|
241
|
+
end
|
229
242
|
end
|
230
243
|
|
231
244
|
describe "#last_response" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookingsync-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Grosjean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|