lhc 10.1.6 → 10.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lhc.gemspec +1 -1
- data/lib/lhc/formats/json.rb +4 -2
- data/lib/lhc/version.rb +1 -1
- data/spec/formats/json_spec.rb +6 -2
- data/spec/response/data_accessor_spec.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe73de18018f898266e7bd978cdf55a2e38a6f3bc8d623ba54aff8d0692e050d
|
4
|
+
data.tar.gz: 3f224a4bf08673247ca7b0c844d5fac704bb6187f7ff4151a91533d9c422cca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eedbda34d438ce8581e711e2c9f6d4cad9f3c5e188ff42ece46e1cf4f8904b3eab0047d11c61ed731ad15606e2e9dca6487458037d6adceb9ef28f120df66b9e
|
7
|
+
data.tar.gz: 705e45b749faa35fe6bb6b0a71512808cb8507b21c21bd19da36ba8df5d14ca4c550cebba6014fdfb22e92fca77a6fbab4b7be33e0905993b539f5ae7b15b94d
|
data/lhc.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_development_dependency 'geminabox'
|
30
30
|
s.add_development_dependency 'prometheus-client', '~> 0.7.1'
|
31
31
|
s.add_development_dependency 'pry'
|
32
|
-
s.add_development_dependency 'rails', '
|
32
|
+
s.add_development_dependency 'rails', '>= 4.2'
|
33
33
|
s.add_development_dependency 'rspec-rails', '>= 3.0.0'
|
34
34
|
s.add_development_dependency 'rubocop', '~> 0.57.1'
|
35
35
|
s.add_development_dependency 'rubocop-rspec', '~> 1.26.0'
|
data/lib/lhc/formats/json.rb
CHANGED
@@ -12,9 +12,11 @@ module LHC::Formats
|
|
12
12
|
def format_options(options)
|
13
13
|
options[:headers] ||= {}
|
14
14
|
no_content_type_header!(options)
|
15
|
-
options[:headers]['Content-Type'] = 'application/json; charset=utf-8'
|
16
15
|
no_accept_header!(options)
|
17
|
-
|
16
|
+
|
17
|
+
options[:headers]['Content-Type'] = 'application/json; charset=utf-8'
|
18
|
+
options[:headers]['Accept'] = 'application/json,application/vnd.api+json'
|
19
|
+
options[:headers]['Accept-Charset'] = 'utf-8'
|
18
20
|
options
|
19
21
|
end
|
20
22
|
|
data/lib/lhc/version.rb
CHANGED
data/spec/formats/json_spec.rb
CHANGED
@@ -4,9 +4,13 @@ require 'rails_helper'
|
|
4
4
|
|
5
5
|
describe LHC do
|
6
6
|
context 'formats' do
|
7
|
-
it 'adds Content-Type and Accept Headers to the request' do
|
7
|
+
it 'adds Content-Type, Accept and Accept-Charset Headers to the request' do
|
8
8
|
stub_request(:get, "http://local.ch/")
|
9
|
-
.with(headers: {
|
9
|
+
.with(headers: {
|
10
|
+
'Accept' => 'application/json,application/vnd.api+json',
|
11
|
+
'Content-Type' => 'application/json; charset=utf-8',
|
12
|
+
'Accept-Charset' => 'utf-8'
|
13
|
+
})
|
10
14
|
.to_return(body: {}.to_json)
|
11
15
|
LHC.json.get('http://local.ch')
|
12
16
|
end
|
@@ -6,7 +6,11 @@ describe LHC do
|
|
6
6
|
context 'data accessor (hash with indifferent access)' do
|
7
7
|
before(:each) do
|
8
8
|
stub_request(:get, "http://local.ch/")
|
9
|
-
.with(headers: {
|
9
|
+
.with(headers: {
|
10
|
+
'Accept' => 'application/json,application/vnd.api+json',
|
11
|
+
'Content-Type' => 'application/json; charset=utf-8',
|
12
|
+
'Accept-Charset' => 'utf-8'
|
13
|
+
})
|
10
14
|
.to_return(body: { 'MyProp' => 'MyValue' }.to_json)
|
11
15
|
end
|
12
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.1.
|
4
|
+
version: 10.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhc/contributors
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
name: rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '4.2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '4.2'
|
111
111
|
- !ruby/object:Gem::Dependency
|