lhs 5.6.1 → 5.6.2

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: 22fe151ea6957f5e5ba5499f9aef9813ed509585
4
- data.tar.gz: fdbcd2ca3a9f3f4b2b184d569a7ca6104bd14d02
3
+ metadata.gz: 5a43dbce3e42155e7cfee8eb357280b08bc7edff
4
+ data.tar.gz: 531ad3f58fc5580ddaf3bdde2dbf4cb5e5819147
5
5
  SHA512:
6
- metadata.gz: a3337032c7268baf6195e3fbdf0ce79b479012e5b2b9549235910eefa9b257a2e555f2b0abb89ec6acba269a4bcc281402801af1fd9be68c42ce2e6ca838886c
7
- data.tar.gz: 4b553c5d03edd61359d0a267e9eeb82be972c4175599e640aa6ae16eb9cfe66e41cfdb197d7b757575b3ea748f64857d8d36e40e83793c3c0e81873b1636d61c
6
+ metadata.gz: 35debe93f1bd53eac8c4996466c19fa0dc48f2ee1ba6e050beb4d7eaa52930ca807f956bbe6bacfd3c98ec2f4ce59d8f29a5eba315733f725f3ddbf4dece7baf
7
+ data.tar.gz: ce24d6cfd4c0cc123ff49594a6f66d9253e5fe4419192623ffb53ee53b834cfcd07670bad42b8c2eaf611996da66844e264037c6a2f32e7f07f30973bd2c5ecd
@@ -25,7 +25,11 @@ class LHS::Item < LHS::Proxy
25
25
  endpoint.remove_interpolated_params!(data)
26
26
  end
27
27
 
28
- data = record.request(options.merge(method: :post, url: url, body: data.to_json, headers: { 'Content-Type' => 'application/json' }))
28
+ options = options.merge(method: :post, url: url, body: data.to_json)
29
+ options[:headers] ||= {}
30
+ options[:headers].merge!('Content-Type' => 'application/json')
31
+
32
+ data = record.request(options)
29
33
  _data.merge_raw!(data)
30
34
  true
31
35
  end
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "5.6.1"
2
+ VERSION = "5.6.2"
3
3
  end
@@ -50,5 +50,17 @@ describe LHS::Item do
50
50
  .to_return(status: 500)
51
51
  expect(-> { item.save! }).to raise_error LHC::ServerError
52
52
  end
53
+
54
+ it 'keeps header psassed in the options' do
55
+ headers = { 'Stats' => 'first-access' }
56
+ request = stub_request(:post, item.href)
57
+ .with(
58
+ body: item._raw.to_json,
59
+ headers: headers)
60
+ .to_return(status: 200, body: item._raw.to_json)
61
+
62
+ item.save!(headers: headers)
63
+ expect(request).to have_been_requested
64
+ end
53
65
  end
54
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.1
4
+ version: 5.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhs/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  requirements:
345
345
  - Ruby >= 1.9.2
346
346
  rubyforge_project:
347
- rubygems_version: 2.2.2
347
+ rubygems_version: 2.2.5
348
348
  signing_key:
349
349
  specification_version: 4
350
350
  summary: Rails gem providing an easy, active-record-like interface for http json services