intercom 3.5.20 → 3.5.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/changes.txt +5 -0
- data/lib/intercom/request.rb +2 -1
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/request_spec.rb +6 -6
- 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: 1ea6f75d92d9202cfbc6fe25b4336c3a4081efb1
|
4
|
+
data.tar.gz: e3444b8fec87362f93ba4fa6a7f59d7960edf557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9940e952b926c8c918507e27fd7a01a58318f0994ca8e25a1a61a88c63d5ddcf0b2b7b3cb5e5e911eed3a4752903ae9e24468ac23885b2bcbea41206f34509b2
|
7
|
+
data.tar.gz: 11ede13348d1697930f2b6c7198dbda65efd3235491b79552e1b62a1f9ec39811f17dad25e7608756f8cb47d8a25c28fa6081f104da0d1262bf00adb5fbdb4c0
|
data/README.md
CHANGED
data/changes.txt
CHANGED
data/lib/intercom/request.rb
CHANGED
@@ -100,7 +100,8 @@ module Intercom
|
|
100
100
|
rescue JSON::ParserError => _
|
101
101
|
raise_errors_on_failure(response)
|
102
102
|
end
|
103
|
-
|
103
|
+
raise_errors_on_failure(response) if parsed_body.nil?
|
104
|
+
raise_application_errors_on_failure(parsed_body, response.code.to_i) if parsed_body['type'] == 'error.list'
|
104
105
|
parsed_body
|
105
106
|
end
|
106
107
|
|
data/lib/intercom/version.rb
CHANGED
@@ -16,6 +16,12 @@ describe 'Intercom::Request' do
|
|
16
16
|
proc {req.parse_body('<html>somethjing</html>', response)}.must_raise(Intercom::RateLimitExceeded)
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'parse_body raises an error if the decoded_body is "null"' do
|
20
|
+
response = OpenStruct.new(:code => 500)
|
21
|
+
req = Intercom::Request.new('path/', 'GET')
|
22
|
+
proc { req.parse_body('null', response)}.must_raise(Intercom::ServerError)
|
23
|
+
end
|
24
|
+
|
19
25
|
describe 'Intercom::Client' do
|
20
26
|
let (:client) { Intercom::Client.new(token: 'foo', handle_rate_limit: true) }
|
21
27
|
let (:uri) {"https://api.intercom.io/users"}
|
@@ -62,10 +68,4 @@ describe 'Intercom::Request' do
|
|
62
68
|
req = Intercom::Request.new('path/', 'GET')
|
63
69
|
assert_nil(req.parse_body(nil, response))
|
64
70
|
end
|
65
|
-
|
66
|
-
it 'parse_body returns nil if the decoded_body is "null"' do
|
67
|
-
response = OpenStruct.new(:code => 500)
|
68
|
-
req = Intercom::Request.new('path/', 'GET')
|
69
|
-
req.parse_body('null', response).must_equal(nil)
|
70
|
-
end
|
71
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2017-10-
|
18
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|