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: 297041c927ac94cf6fd56b2c8994adc58a5d2962
4
- data.tar.gz: b9b106fc73c0ca792bb5c899916d636f2bd02b77
3
+ metadata.gz: 1c4e6cd8678c43838cd16404afda232617573958
4
+ data.tar.gz: 4bef59232d6e3937eb82633008fe4c659e58a5a8
5
5
  SHA512:
6
- metadata.gz: 90c91f15b4ee3f3a8aa0cf0d23510372c8ffb80b92598b0d1fe08a8bddc6f6c135c1d95ae3d3c85dd61bed572f6e284147c7b76772d90c61bd7e44255eb29441
7
- data.tar.gz: 8287a9f009569a5dc5780817a9ef1c915f7f3106d1f3b9777466dfad6a1cc118321ba308f1b660ce658e0c0c5b1efd255785daeff758e4dbfbe3c8f95a03897c
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 }
@@ -1,5 +1,5 @@
1
1
  module BookingSync
2
2
  module API
3
- VERSION = "0.0.17"
3
+ VERSION = "0.0.18"
4
4
  end
5
5
  end
@@ -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.17
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-21 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday