intercom 3.8.0 → 3.8.1
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/README.md +1 -1
- data/changes.txt +4 -0
- data/lib/intercom/request.rb +1 -1
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/request_spec.rb +12 -5
- 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: 82e1587dad8e896255cd493bccb9cb2a389ddf1805aead74cd1a645ebbc6eac4
|
4
|
+
data.tar.gz: 53ad03e351f26b5c67558ffc2195811732980d746d1b5d54681d7a8f98360ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa0433095b490feb4810fe1ad432a0de9c7007f1eb5bcf7cc3725658c0c23b85daf3f4339f1d71b9a9a522c4a55eaaf011c394a3543eb1c6957306389115732
|
7
|
+
data.tar.gz: f90a678af75d18574ee46c786f7ad954c9d8164642c4b161ae9dd10e15160cef319981c28b2ad0fb891f40a9fefd0df3d784c5ea10cf090dce5b916112e86b4d
|
data/README.md
CHANGED
data/changes.txt
CHANGED
data/lib/intercom/request.rb
CHANGED
@@ -171,7 +171,7 @@ module Intercom
|
|
171
171
|
raise Intercom::BadRequestError.new(error_details['message'], error_context)
|
172
172
|
when "not_restorable"
|
173
173
|
raise Intercom::BlockedUserError.new(error_details['message'], error_context)
|
174
|
-
when "not_found"
|
174
|
+
when "not_found", "company_not_found"
|
175
175
|
raise Intercom::ResourceNotFound.new(error_details['message'], error_context)
|
176
176
|
when "admin_not_found"
|
177
177
|
raise Intercom::AdminNotFound.new(error_details['message'], error_context)
|
data/lib/intercom/version.rb
CHANGED
@@ -37,7 +37,7 @@ describe 'Intercom::Request' do
|
|
37
37
|
req = Intercom::Request.get(uri, "")
|
38
38
|
req.handle_rate_limit=true
|
39
39
|
req.expects(:sleep).times(3).with(any_parameters)
|
40
|
-
req.execute(
|
40
|
+
req.execute(uri, username: "ted", secret: "")
|
41
41
|
}.must_raise(Intercom::RateLimitExceeded)
|
42
42
|
end
|
43
43
|
|
@@ -48,7 +48,7 @@ describe 'Intercom::Request' do
|
|
48
48
|
req = Intercom::Request.get(uri, "")
|
49
49
|
req.handle_rate_limit=true
|
50
50
|
req.expects(:sleep).never.with(any_parameters)
|
51
|
-
req.execute(
|
51
|
+
req.execute(uri, username: "ted", secret: "")
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'should call sleep for rate limit error just once' do
|
@@ -59,7 +59,7 @@ describe 'Intercom::Request' do
|
|
59
59
|
req = Intercom::Request.get(uri, "")
|
60
60
|
req.handle_rate_limit=true
|
61
61
|
req.expects(:sleep).with(any_parameters)
|
62
|
-
req.execute(
|
62
|
+
req.execute(uri, username: "ted", secret: "")
|
63
63
|
end
|
64
64
|
|
65
65
|
it 'should not sleep if rate limit reset time has passed' do
|
@@ -70,7 +70,7 @@ describe 'Intercom::Request' do
|
|
70
70
|
req = Intercom::Request.get(uri, "")
|
71
71
|
req.handle_rate_limit=true
|
72
72
|
req.expects(:sleep).never.with(any_parameters)
|
73
|
-
req.execute(
|
73
|
+
req.execute(uri, username: "ted", secret: "")
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -82,7 +82,7 @@ describe 'Intercom::Request' do
|
|
82
82
|
stub_request(:put, uri).\
|
83
83
|
to_return(status: [409, "Resource Already Exists"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }, body: {type: "error.list", errors: [ code: "resource_conflict" ]}.to_json)
|
84
84
|
req = Intercom::Request.put(uri, "")
|
85
|
-
expect { req.execute(
|
85
|
+
expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotUniqueError)
|
86
86
|
end
|
87
87
|
|
88
88
|
it 'should raise ApiVersionInvalid error on intercom_version_invalid code' do
|
@@ -92,6 +92,13 @@ describe 'Intercom::Request' do
|
|
92
92
|
req = Intercom::Request.put(uri, "")
|
93
93
|
expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ApiVersionInvalid)
|
94
94
|
end
|
95
|
+
|
96
|
+
it 'should raise ResourceNotFound error on company_not_found code' do
|
97
|
+
stub_request(:put, uri).\
|
98
|
+
to_return(status: [404, "Not Found"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }, body: {type: "error.list", errors: [ code: "company_not_found" ]}.to_json)
|
99
|
+
req = Intercom::Request.put(uri, "")
|
100
|
+
expect { req.execute(uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotFound)
|
101
|
+
end
|
95
102
|
end
|
96
103
|
|
97
104
|
it 'parse_body returns nil if decoded_body is nil' do
|
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.8.
|
4
|
+
version: 3.8.1
|
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: 2019-
|
18
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.7.
|
238
|
+
rubygems_version: 2.7.6.2
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Ruby bindings for the Intercom API
|