ddy_remote_resource 1.0.0 → 1.0.1

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: f5a921abd25953a42365c383740ed5bdea703c04
4
- data.tar.gz: 5644b3a134c6ff76ae816852f8c13a2b79d00260
3
+ metadata.gz: 5a258ef2eff87f5be59c4093c6828fc2e0731690
4
+ data.tar.gz: 7f57020b0b01dad3bdb83f9de6f065e8c9fbf3c4
5
5
  SHA512:
6
- metadata.gz: 9a2b24dd6b7de07771f6f8f3d9722ff7b53732ea28732e0897b4faca27c1606dbaa7f25c2a9f11b8298898259e77092d6ac22af940c2c17698de4c8590478ad1
7
- data.tar.gz: f31164b21417e9005a09cedfa277ec5f186218ffb81bfa471bfa8ebbd6241e1494e94bee62b9762ae9b8dcecdd7657846fd5a906f6986665f307dec294b4c9bd
6
+ metadata.gz: 95d6b936bdbb2f51688872015867a5f8f5adf5c825ef75c73f451717805284c934ceeb2e4fb2f0de44b622628690ad9757662b0854e0a24f321385060de7b8d2
7
+ data.tar.gz: 52d4ec2f67b9be0f016c07d9471ac9451b6df1bb873f6a071df23453932ddbe861a6263eb60a72a61c100e64feddb37978f06f0c428296349b3181b15869760f
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in remote_resource.gemspec
4
4
  gemspec
5
5
 
6
- gem 'webmock', github: 'JanDintel/webmock', branch: ' feature/ignore-json-keys-order'
6
+ gem 'webmock', git: 'https://github.com/JanDintel/webmock.git', branch: 'feature/ignore-json-keys-order'
@@ -106,6 +106,7 @@ module RemoteResource
106
106
  def conditional_headers
107
107
  headers = {}
108
108
  headers = headers.merge(DEFAULT_CONTENT_TYPE) if body.present?
109
+ headers = headers.merge({ 'X-Request-Id' => Thread.current[:request_id] }) if Thread.current[:request_id].present?
109
110
  headers
110
111
  end
111
112
 
@@ -1,3 +1,3 @@
1
1
  module RemoteResource
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -528,8 +528,9 @@ RSpec.describe RemoteResource::Request do
528
528
  end
529
529
 
530
530
  context 'when conditional_headers are present' do
531
+ let(:http_action) { 'post' }
532
+
531
533
  context 'when a body is present' do
532
- let(:http_action) { 'post' }
533
534
  let(:expected_headers) do
534
535
  { 'Accept' => 'application/json', 'User-Agent' => "RemoteResource #{RemoteResource::VERSION}", 'Content-Type' => 'application/json' }
535
536
  end
@@ -538,6 +539,24 @@ RSpec.describe RemoteResource::Request do
538
539
  expect(request.headers).to eql expected_headers
539
540
  end
540
541
  end
542
+
543
+ context 'when Thread.current[:request_id] is present' do
544
+ before do
545
+ Thread.current[:request_id] = 'CASCADING-REQUEST-ID'
546
+ end
547
+
548
+ after do
549
+ Thread.current[:request_id] = nil
550
+ end
551
+
552
+ let(:expected_headers) do
553
+ { 'Accept' => 'application/json', 'User-Agent' => "RemoteResource #{RemoteResource::VERSION}", 'Content-Type' => 'application/json', 'X-Request-Id' => 'CASCADING-REQUEST-ID' }
554
+ end
555
+
556
+ it 'returns the default headers with the X-Request-Id header' do
557
+ expect(request.headers).to eql expected_headers
558
+ end
559
+ end
541
560
  end
542
561
  end
543
562
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe RemoteResource::VERSION do
4
- it { is_expected.to eql '1.0.0' }
4
+ it { is_expected.to eql '1.0.1' }
5
5
  end
6
6
 
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddy_remote_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan van der Pas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2017-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler