xhash_client 0.3.4 → 0.3.5

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
  SHA256:
3
- metadata.gz: b6783bebe798aba1d8ea8082b7f1e40c8c4cb6a3af77734313217ef0b7a90832
4
- data.tar.gz: a154fd54e709a7d7907ad9ed0ba67c05d2a11fe0b77a38bc23ce86b76f3eecd7
3
+ metadata.gz: 51cfc749e3e0033b38f6c080a3b879cb23d529d4ff2b18be8b51bb00dbaebe01
4
+ data.tar.gz: a63139c2bfe211afd2e9071577b791e194dbc5fe66512d8da5973bb8a8ddeaf4
5
5
  SHA512:
6
- metadata.gz: 7fa48096137d96837e81cc9e3d9fc322a8ba82ecb4e7547b65e96b498d2da1807c21d2bf3ca8fee7052b41f182da61a36030a0d9fa57b04154672826cfe7b5d1
7
- data.tar.gz: f6135f52e4ed40d539d291891a931b3c20828f48845489d5977b1f543f4ba8972b02567c58838923e37632a86249d1ff480be9f1fea46d355584c1106b757870
6
+ metadata.gz: 8aa84976a5e204f2357f4be92aca1292369d8f0dab40fa89ef8e9cc4b7cdc11e7230cda637df725d5a3b7e07f4713b44bc0a7e6085d3a81201ce23da063f1df2
7
+ data.tar.gz: 64fdd3eaa5c9276b8ff27411e641e500b185d25041f672e71d7c6333019e9d40fc2e9950964a240b90af2b6f9dc979400591ed8a956a3341b6609b336e0c8a0c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xhash_client (0.3.3)
4
+ xhash_client (0.3.4)
5
5
  httparty (~> 0.16.0)
6
6
  json (~> 2.0)
7
7
 
@@ -21,7 +21,7 @@ GEM
21
21
  json (2.2.0)
22
22
  mime-types (3.3.1)
23
23
  mime-types-data (~> 3.2015)
24
- mime-types-data (3.2019.1009)
24
+ mime-types-data (3.2020.0512)
25
25
  multi_xml (0.6.0)
26
26
  public_suffix (4.0.1)
27
27
  rspec (3.8.0)
@@ -3,8 +3,14 @@ module Xhash
3
3
  attr_reader :message, :response
4
4
 
5
5
  def initialize(options = {})
6
- @message = options[:message]
7
- @response = options[:response]
6
+ if options.is_a? Hash
7
+ @message = options[:message]
8
+ @response = options[:response]
9
+ else
10
+ @message = "Server error"
11
+ @response = options
12
+ end
13
+
8
14
  super
9
15
  end
10
16
  end
@@ -1,3 +1,3 @@
1
1
  module Xhash
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
@@ -304,6 +304,24 @@ describe Xhash::OCR do
304
304
  expect(exception).to be_a(Xhash::InvalidFieldError)
305
305
  end
306
306
  end
307
+
308
+ it 'fails to serialize to document with html error' do
309
+ stub_request(:post, 'https://xhash.dev/api/ocr/proof-of-address').to_return(
310
+ body: '<p>error</p>',
311
+ status: 500,
312
+ headers: { 'Content-Type' => 'text/html; charset=UTF-8' }
313
+ )
314
+
315
+ begin
316
+ ine =
317
+ Xhash::OCR.proof_of_address(
318
+ document_url:
319
+ 'https://kyc-xhash.s3-us-west-2.amazonaws.com/documents/7cd6994d9ad52e8943be1ae00bac60c461430cdf2af6159afa4b9be749706472.png'
320
+ )
321
+ rescue => exception
322
+ expect(exception).to be_a(Xhash::Error)
323
+ end
324
+ end
307
325
  end
308
326
 
309
327
  describe '.ine_reverse' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xhash_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yellowme