lhs 6.7.1 → 6.7.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/.rubocop.yml +4 -0
- data/lib/lhs/concerns/item/save.rb +1 -0
- data/lib/lhs/version.rb +1 -1
- data/spec/item/save_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68d9eea1eeef7f8711bc52a5f502889db86060f3
|
4
|
+
data.tar.gz: ace1d44c61822943f8d388abb1ca0729a539bd56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 036a2f4aec3cdba0aab5c5291187725740df70c8613e1651f9b371ef5f17e3908cc57465f461ea3bc1fa4fa873c746c3ec75488571052abb26ba06ea13891ce2
|
7
|
+
data.tar.gz: 0e307ed787e902e0b0b0c37f3665965ef52c8d1909d55cc3f6e95c0a66fe2ba38859b36482ecc275f407bad9f84b00e937b2f4e6f016bd1e33d1fc55eb286e88
|
data/.rubocop.yml
CHANGED
@@ -23,6 +23,7 @@ class LHS::Item < LHS::Proxy
|
|
23
23
|
endpoint = record.find_endpoint(data)
|
24
24
|
url = endpoint.compile(data)
|
25
25
|
endpoint.remove_interpolated_params!(data)
|
26
|
+
options.merge!(endpoint.options.merge(options)) if endpoint.options
|
26
27
|
end
|
27
28
|
|
28
29
|
options = options.merge(method: :post, url: url, body: data.to_json)
|
data/lib/lhs/version.rb
CHANGED
data/spec/item/save_spec.rb
CHANGED
@@ -20,6 +20,24 @@ describe LHS::Item do
|
|
20
20
|
data[0]
|
21
21
|
end
|
22
22
|
|
23
|
+
context 'endpoint options' do
|
24
|
+
let(:headers) { { 'X-Header' => 'VALUE' } }
|
25
|
+
|
26
|
+
before(:each) do
|
27
|
+
class RecordWithOptions < LHS::Record
|
28
|
+
endpoint 'http://datastore/records', headers: { 'X-Header' => 'VALUE' }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'considers end point options when saving' do
|
33
|
+
data = { name: 'Steve' }
|
34
|
+
stub_request(:post, "http://datastore/records")
|
35
|
+
.with(body: data.to_json, headers: headers)
|
36
|
+
.to_return(body: data.to_json)
|
37
|
+
RecordWithOptions.create!(data)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
23
41
|
context 'save' do
|
24
42
|
it 'persists changes on the backend' do
|
25
43
|
stub_request(:post, item.href).with(body: item._raw.merge(name: 'Steve').to_json)
|
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: 6.7.
|
4
|
+
version: 6.7.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-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|