lhs 14.3.2 → 14.3.3

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: 23918846d8c64e8753d97597980490a1e81727db
4
- data.tar.gz: 0b7aa7f5dc6a6621959f76391aab092b69655b46
3
+ metadata.gz: faac20a893bc5f0b14a162d5d2aa558c47d6939e
4
+ data.tar.gz: e821d49493af8481912155de04685e493125f6e6
5
5
  SHA512:
6
- metadata.gz: ed8155be2929a3ba33c54f3f26b8f3c7d3dc55ab86a71b235eda98001e4132e4b979d2e294c6e066950aa770fc839ee9498461a554ae69123f5354fd4df15dfe
7
- data.tar.gz: 85f20098c747b9e2f3596169ef1f48e2577f95e5f53cc0b97c39aeaaaa86c226b62a5db6c9d97357bf8f99c04624e9c677d9f41b9f248946396cba412c83ad65
6
+ metadata.gz: 7b2e761d4b8354dfc417c09f88b581c420773bad5206e7581f1e969f50cb661590a70776acef43ae84d753b3d7daabb08f31d42314f5eed82c14f84fbe3fce5a
7
+ data.tar.gz: 7804df813f9ed2e795c8323307a911d47b1eaaf5ec93a308cf1dc893ca2ac7a34a18504faecb0ab11c219c69ae24d32c5edfb713a477c4117d9392dc8a48d987
@@ -434,7 +434,7 @@ class LHS::Record
434
434
  options[:ignored_errors] = ignored_errors if ignored_errors.present?
435
435
  options[:params].deep_symbolize_keys! if options[:params]
436
436
  options[:error_handler] = merge_error_handlers(options[:error_handler]) if options[:error_handler]
437
- options = (endpoint.options || {}).merge(options)
437
+ options = (endpoint.options || {}).deep_merge(options)
438
438
  options[:url] = compute_url!(options[:params]) unless options.key?(:url)
439
439
  merge_explicit_params!(options[:params])
440
440
  options.delete(:params) if options[:params] && options[:params].empty?
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = '14.3.2'
2
+ VERSION = '14.3.3'
3
3
  end
@@ -17,5 +17,27 @@ describe LHS::Record do
17
17
  stub_request(:get, "http://backend/v2/feedbacks/1").to_return(status: 200)
18
18
  Record.find(1)
19
19
  end
20
+
21
+ context 'deep merge endpoint options' do
22
+
23
+ before(:each) do
24
+ class Location < LHS::Record
25
+ endpoint 'http://uberall/locations', headers: { privateKey: '123' }
26
+ end
27
+ end
28
+
29
+ it 'deep merges options to not overwrite endpoint options' do
30
+ stub_request(:get, "http://uberall/locations")
31
+ .with(
32
+ headers: {
33
+ 'Privatekey' => '123',
34
+ 'Accept' => 'application/json'
35
+ }
36
+ )
37
+ .to_return(body: [].to_json)
38
+
39
+ Location.options(headers: { 'Accept' => 'application/json' }).fetch
40
+ end
41
+ end
20
42
  end
21
43
  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: 14.3.2
4
+ version: 14.3.3
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: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc