lhs 5.6.1 → 5.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lhs/concerns/item/save.rb +5 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/item/save_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a43dbce3e42155e7cfee8eb357280b08bc7edff
|
4
|
+
data.tar.gz: 531ad3f58fc5580ddaf3bdde2dbf4cb5e5819147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/lhs/version.rb
CHANGED
data/spec/item/save_spec.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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
|