rev-api 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -1
- data/.gitignore +21 -21
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +8 -8
- data/Gemfile +3 -3
- data/LICENSE +191 -191
- data/README.md +132 -132
- data/Rakefile +13 -13
- data/examples/cli.rb +270 -270
- data/lib/rev-api.rb +25 -25
- data/lib/rev-api/api.rb +326 -326
- data/lib/rev-api/api_serializable.rb +30 -30
- data/lib/rev-api/exceptions.rb +97 -100
- data/lib/rev-api/http_client.rb +97 -97
- data/lib/rev-api/models/order.rb +130 -138
- data/lib/rev-api/models/order_request.rb +194 -222
- data/lib/rev-api/version.rb +3 -3
- data/rev-api.gemspec +34 -34
- data/spec/fixtures/api_cassettes/cancel_order.yml +38 -38
- data/spec/fixtures/api_cassettes/cancel_order_not_allowed.yml +40 -40
- data/spec/fixtures/api_cassettes/get_attachment_content.yml +399 -399
- data/spec/fixtures/api_cassettes/get_attachment_content_as_pdf.yml +399 -399
- data/spec/fixtures/api_cassettes/get_attachment_content_as_text.yml +65 -65
- data/spec/fixtures/api_cassettes/get_attachment_content_as_youtube_transcript.yml +66 -66
- data/spec/fixtures/api_cassettes/get_attachment_content_unacceptable_representation.yml +42 -42
- data/spec/fixtures/api_cassettes/get_attachment_content_with_invalid_id.yml +42 -42
- data/spec/fixtures/api_cassettes/get_attachment_metadata.yml +42 -42
- data/spec/fixtures/api_cassettes/get_attachment_with_invalid_id.yml +40 -40
- data/spec/fixtures/api_cassettes/get_orders.yml +122 -122
- data/spec/fixtures/api_cassettes/get_orders_with_clientRef.yml +41 -41
- data/spec/fixtures/api_cassettes/get_tc_order.yml +44 -44
- data/spec/fixtures/api_cassettes/get_third_page_of_orders.yml +52 -58
- data/spec/fixtures/api_cassettes/link_input.yml +44 -44
- data/spec/fixtures/api_cassettes/link_input_with_all_attributes.yml +44 -44
- data/spec/fixtures/api_cassettes/link_input_with_spaces_in_filename.yml +45 -45
- data/spec/fixtures/api_cassettes/not_found_order.yml +42 -42
- data/spec/fixtures/api_cassettes/submit_cp_order.yml +45 -45
- data/spec/fixtures/api_cassettes/submit_su_order.yml +45 -45
- data/spec/fixtures/api_cassettes/submit_tc_order_with_account_balance.yml +45 -45
- data/spec/fixtures/api_cassettes/submit_tc_order_with_invalid_request.yml +45 -45
- data/spec/fixtures/api_cassettes/submit_tc_order_without_specifying_payment.yml +45 -45
- data/spec/fixtures/api_cassettes/unauthorized.yml +42 -42
- data/spec/fixtures/api_cassettes/upload_input.yml +90 -90
- data/spec/fixtures/api_cassettes/upload_input_with_invalid_content_type.yml +91 -91
- data/spec/lib/rev/api_spec.rb +24 -24
- data/spec/lib/rev/cancel_order_spec.rb +24 -24
- data/spec/lib/rev/exceptions_spec.rb +8 -8
- data/spec/lib/rev/get_attachment_content_spec.rb +79 -79
- data/spec/lib/rev/get_attachment_metadata_spec.rb +33 -33
- data/spec/lib/rev/get_order_spec.rb +52 -68
- data/spec/lib/rev/get_orders_spec.rb +62 -62
- data/spec/lib/rev/http_client_spec.rb +32 -32
- data/spec/lib/rev/models/order_request_spec.rb +0 -7
- data/spec/lib/rev/models/order_spec.rb +58 -58
- data/spec/lib/rev/post_inputs_spec.rb +94 -94
- data/spec/lib/rev/post_order_spec.rb +163 -195
- data/spec/spec_helper.rb +49 -49
- metadata +38 -41
- data/spec/fixtures/api_cassettes/get_tr_order.yml +0 -44
- data/spec/fixtures/api_cassettes/submit_tr_order.yml +0 -44
@@ -1,42 +1,42 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://api-sandbox.rev.com/api/v1/orders?page=0
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Authorization:
|
11
|
-
- Rev welcome:trololo
|
12
|
-
User-Agent:
|
13
|
-
- RevOfficialRubySDK/1.0.0
|
14
|
-
response:
|
15
|
-
status:
|
16
|
-
code: 401
|
17
|
-
message: Unauthorized
|
18
|
-
headers:
|
19
|
-
Cache-Control:
|
20
|
-
- no-cache
|
21
|
-
Pragma:
|
22
|
-
- no-cache
|
23
|
-
Expires:
|
24
|
-
- '-1'
|
25
|
-
Server:
|
26
|
-
- Microsoft-IIS/8.0
|
27
|
-
Www-Authenticate:
|
28
|
-
- Rev
|
29
|
-
X-Miniprofiler-Ids:
|
30
|
-
- ! '["5b5d655c-3f79-4e76-8e24-c6e36b7170fb"]'
|
31
|
-
X-Powered-By:
|
32
|
-
- ASP.NET
|
33
|
-
Date:
|
34
|
-
- Thu, 12 Sep 2013 18:38:00 GMT
|
35
|
-
Content-Length:
|
36
|
-
- '0'
|
37
|
-
body:
|
38
|
-
encoding: US-ASCII
|
39
|
-
string: ''
|
40
|
-
http_version:
|
41
|
-
recorded_at: Thu, 12 Sep 2013 18:38:05 GMT
|
42
|
-
recorded_with: VCR 2.5.0
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api-sandbox.rev.com/api/v1/orders?page=0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- Rev welcome:trololo
|
12
|
+
User-Agent:
|
13
|
+
- RevOfficialRubySDK/1.0.0
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 401
|
17
|
+
message: Unauthorized
|
18
|
+
headers:
|
19
|
+
Cache-Control:
|
20
|
+
- no-cache
|
21
|
+
Pragma:
|
22
|
+
- no-cache
|
23
|
+
Expires:
|
24
|
+
- '-1'
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/8.0
|
27
|
+
Www-Authenticate:
|
28
|
+
- Rev
|
29
|
+
X-Miniprofiler-Ids:
|
30
|
+
- ! '["5b5d655c-3f79-4e76-8e24-c6e36b7170fb"]'
|
31
|
+
X-Powered-By:
|
32
|
+
- ASP.NET
|
33
|
+
Date:
|
34
|
+
- Thu, 12 Sep 2013 18:38:00 GMT
|
35
|
+
Content-Length:
|
36
|
+
- '0'
|
37
|
+
body:
|
38
|
+
encoding: US-ASCII
|
39
|
+
string: ''
|
40
|
+
http_version:
|
41
|
+
recorded_at: Thu, 12 Sep 2013 18:38:05 GMT
|
42
|
+
recorded_with: VCR 2.5.0
|
@@ -1,90 +1,90 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://www.revtrunk.com/api/v1/inputs
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: !binary |-
|
9
|
-
iVBORw0KGgoAAAANSUhEUgAAAHMAAAAyCAYAAABvR+QvAAAGtklEQVR42u2c
|
10
|
-
z2scZRjH9w9QMxFBPEhHm7Smoe2ANGnamAxWqEqR9SIKoiOoeJIRc/Ako0gR
|
11
|
-
L4N48eTQowcdCAgWU6dumzSpttOiF0+DB3+kye5E/Bk1Xd/ZPKNvJzu77/O+
|
12
|
-
z0w2dA9fFtLu7Mz7eZ+f7ztvpdlsVjqpcWiocF1YnD8Gev7C4kLtRs2vMTUl
|
13
|
-
tZa53iz721ugGe53B8t4Thl148OrIgBTZ6oyORKymUyqB5u/GmpMJshicphc
|
14
|
-
poApZGoqKoJreXDt5DfMHQ8TIIRMTRKN7zm1OnXgoaIfngOewg4AkiroGK6V
|
15
|
-
QjZ2BEx2EYsM4la52zXLvzz9ycOLC+dmwPIoLLkJgF0ArHe7BzahB9nEfg7G
|
16
|
-
IUhVnxh5tSiYUYEwE3m9EpPAihNr88H6KFx1MlmszG8locrvMi4mKUx2AaNg
|
17
|
-
kKmsXkw4EvfJuWcVqK+3LPGB/Xewz88Ex4QcZrUkmFGvZpCpLp6du33p3NkX
|
18
|
-
F766eApptR8n3//xsem72OfXiDHRqWE6JcFsgheo7BQxSFVwoZ1Ahovnv7iF
|
19
|
-
gdyFDFceecyEi5YF00YOqAGu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-
Content-Disposition:
|
55
|
-
- attachment; filename="sourcedocument.png"
|
56
|
-
Content-Type:
|
57
|
-
- image/png
|
58
|
-
Accept:
|
59
|
-
- '*/*'
|
60
|
-
Content-Length:
|
61
|
-
- '1775'
|
62
|
-
response:
|
63
|
-
status:
|
64
|
-
code: 201
|
65
|
-
message: Created
|
66
|
-
headers:
|
67
|
-
Cache-Control:
|
68
|
-
- no-cache
|
69
|
-
Pragma:
|
70
|
-
- no-cache
|
71
|
-
Expires:
|
72
|
-
- '-1'
|
73
|
-
Location:
|
74
|
-
- urn:rev:inputmedia:SnVwbG9hZHMvMjAxMy0wOS0yNi9jYzljNGE0MC03NTY3LTQ2YjYtYmVmMi0xMjU5ODgwODNhMWQvc291cmNlZG9jdW1lbnQucG5n
|
75
|
-
Server:
|
76
|
-
- Microsoft-IIS/7.5
|
77
|
-
X-Miniprofiler-Ids:
|
78
|
-
- '["a0f9d7b5-d023-4b9a-9896-f0a2d64de3d3","bf2469f9-1da0-411e-bf13-d2536dad319c","8c9e9962-f48b-4ed4-98cc-418cd675a1ac","b9ff244c-b5cf-4df1-a46f-4ffcb1822ec2","28d29827-cb62-407b-a157-b5e219dcc576"]'
|
79
|
-
X-Powered-By:
|
80
|
-
- ASP.NET
|
81
|
-
Date:
|
82
|
-
- Thu, 26 Sep 2013 19:05:16 GMT
|
83
|
-
Content-Length:
|
84
|
-
- '0'
|
85
|
-
body:
|
86
|
-
encoding: UTF-8
|
87
|
-
string: ''
|
88
|
-
http_version:
|
89
|
-
recorded_at: Thu, 26 Sep 2013 19:05:16 GMT
|
90
|
-
recorded_with: VCR 2.5.0
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://www.revtrunk.com/api/v1/inputs
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: !binary |-
|
9
|
+
iVBORw0KGgoAAAANSUhEUgAAAHMAAAAyCAYAAABvR+QvAAAGtklEQVR42u2c
|
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1h6zl4a
|
41
|
+
6j6tTtzcT2H+zlQTzVwh2QmIXhc0cnfnMZhXERA6dVhiQcvutO1fAxesaqVx
|
42
|
+
l43PmoRrT5OexCrfZhpAdHgoFqG9bjvcN9/k3XR7Pv8mLycf/r3bW8F69m1g
|
43
|
+
7vsO8o0vDazdRVhR2uazEM0FC+4vEoi9yfsjyablXYIQdaKMVWgDtOgBFb0m
|
44
|
+
vZdfBQSX6hBBtKhPG+kLBzEmgGinb4L1YZYLUYd4pgoxbHMOQh9mSRAtggw1
|
45
|
+
holglHWoU183Hl5BYYV+OyvswyzvHIOIwAIt/q3oPsxyYqBNcC5QCAmR0jkL
|
46
|
+
fZh412kTWF96FJuJtb4+THlwVYJDm/gj1gqteW96mAAtPUbNkwQXZ064NEXO
|
47
|
+
xuvDxMc0k4OVnnsXIGJcehRpamEOuFqzrNMqb0qYXExzEKpywE3qONarMP8F
|
48
|
+
PE/RzQd+eHkAAAAASUVORK5CYII=
|
49
|
+
headers:
|
50
|
+
Authorization:
|
51
|
+
- Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
|
52
|
+
User-Agent:
|
53
|
+
- RevOfficialRubySDK/1.0.0
|
54
|
+
Content-Disposition:
|
55
|
+
- attachment; filename="sourcedocument.png"
|
56
|
+
Content-Type:
|
57
|
+
- image/png
|
58
|
+
Accept:
|
59
|
+
- '*/*'
|
60
|
+
Content-Length:
|
61
|
+
- '1775'
|
62
|
+
response:
|
63
|
+
status:
|
64
|
+
code: 201
|
65
|
+
message: Created
|
66
|
+
headers:
|
67
|
+
Cache-Control:
|
68
|
+
- no-cache
|
69
|
+
Pragma:
|
70
|
+
- no-cache
|
71
|
+
Expires:
|
72
|
+
- '-1'
|
73
|
+
Location:
|
74
|
+
- urn:rev:inputmedia:SnVwbG9hZHMvMjAxMy0wOS0yNi9jYzljNGE0MC03NTY3LTQ2YjYtYmVmMi0xMjU5ODgwODNhMWQvc291cmNlZG9jdW1lbnQucG5n
|
75
|
+
Server:
|
76
|
+
- Microsoft-IIS/7.5
|
77
|
+
X-Miniprofiler-Ids:
|
78
|
+
- '["a0f9d7b5-d023-4b9a-9896-f0a2d64de3d3","bf2469f9-1da0-411e-bf13-d2536dad319c","8c9e9962-f48b-4ed4-98cc-418cd675a1ac","b9ff244c-b5cf-4df1-a46f-4ffcb1822ec2","28d29827-cb62-407b-a157-b5e219dcc576"]'
|
79
|
+
X-Powered-By:
|
80
|
+
- ASP.NET
|
81
|
+
Date:
|
82
|
+
- Thu, 26 Sep 2013 19:05:16 GMT
|
83
|
+
Content-Length:
|
84
|
+
- '0'
|
85
|
+
body:
|
86
|
+
encoding: UTF-8
|
87
|
+
string: ''
|
88
|
+
http_version:
|
89
|
+
recorded_at: Thu, 26 Sep 2013 19:05:16 GMT
|
90
|
+
recorded_with: VCR 2.5.0
|
@@ -1,91 +1,91 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://www.revtrunk.com/api/v1/inputs
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: !binary |-
|
9
|
-
iVBORw0KGgoAAAANSUhEUgAAAHMAAAAyCAYAAABvR+QvAAAGtklEQVR42u2c
|
10
|
-
z2scZRjH9w9QMxFBPEhHm7Smoe2ANGnamAxWqEqR9SIKoiOoeJIRc/Ako0gR
|
11
|
-
L4N48eTQowcdCAgWU6dumzSpttOiF0+DB3+kye5E/Bk1Xd/ZPKNvJzu77/O+
|
12
|
-
z0w2dA9fFtLu7Mz7eZ+f7ztvpdlsVjqpcWiocF1YnD8Gev7C4kLtRs2vMTUl
|
13
|
-
tZa53iz721ugGe53B8t4Thl148OrIgBTZ6oyORKymUyqB5u/GmpMJshicphc
|
14
|
-
poApZGoqKoJreXDt5DfMHQ8TIIRMTRKN7zm1OnXgoaIfngOewg4AkiroGK6V
|
15
|
-
QjZ2BEx2EYsM4la52zXLvzz9ycOLC+dmwPIoLLkJgF0ArHe7BzahB9nEfg7G
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064NEXO
|
47
|
-
xuvDxMc0k4OVnnsXIGJcehRpamEOuFqzrNMqb0qYXExzEKpywE3qONarMP8F
|
48
|
-
PE/RzQd+eHkAAAAASUVORK5CYII=
|
49
|
-
headers:
|
50
|
-
Authorization:
|
51
|
-
- Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
|
52
|
-
User-Agent:
|
53
|
-
- RevOfficialRubySDK/1.0.0
|
54
|
-
Content-Disposition:
|
55
|
-
- attachment; filename="sourcedocument.png"
|
56
|
-
Content-Type:
|
57
|
-
- trololo
|
58
|
-
Accept:
|
59
|
-
- '*/*'
|
60
|
-
Content-Length:
|
61
|
-
- '1775'
|
62
|
-
response:
|
63
|
-
status:
|
64
|
-
code: 400
|
65
|
-
message: Bad Request
|
66
|
-
headers:
|
67
|
-
Cache-Control:
|
68
|
-
- no-cache
|
69
|
-
Pragma:
|
70
|
-
- no-cache
|
71
|
-
Content-Type:
|
72
|
-
- application/json; charset=utf-8
|
73
|
-
Expires:
|
74
|
-
- '-1'
|
75
|
-
Server:
|
76
|
-
- Microsoft-IIS/7.5
|
77
|
-
X-Miniprofiler-Ids:
|
78
|
-
- '["a0f9d7b5-d023-4b9a-9896-f0a2d64de3d3","bf2469f9-1da0-411e-bf13-d2536dad319c","8c9e9962-f48b-4ed4-98cc-418cd675a1ac","b9ff244c-b5cf-4df1-a46f-4ffcb1822ec2","28d29827-cb62-407b-a157-b5e219dcc576","d8efeedd-9de7-44b2-ba69-973527be9dbc","22d99839-4b04-495a-96cc-a5e0be8c9a12","2e4c73ef-12ed-464c-aa4f-4bb4ab398c00","3ea6619b-0c1f-4677-9613-0129cc504862","379bbb66-f74e-4d00-95bb-c6abfa4013a9","7a2148f2-ac1d-4822-bfbd-f4c6dc0cf201","77da68b5-42c7-4293-b229-98814a198f8b","3c434af1-18db-4612-b0ed-52147d4e2a5c","3b1e16e9-116e-44ed-b570-e25d0588544b","012dec81-c6a1-4518-a806-4ac3707e1fe9","066e3655-6a5d-40a4-8058-bfd2f07f93a7","20d23bf7-3b81-4012-ab14-4d972f573857","3d423fed-f62e-4f8c-96fb-5213ad3f0d6b"]'
|
79
|
-
X-Powered-By:
|
80
|
-
- ASP.NET
|
81
|
-
Date:
|
82
|
-
- Thu, 26 Sep 2013 19:27:07 GMT
|
83
|
-
Content-Length:
|
84
|
-
- '112'
|
85
|
-
body:
|
86
|
-
encoding: UTF-8
|
87
|
-
string: '{"code":10001,"message":"The content-type explicitly specified in the
|
88
|
-
request is not supported for input media"}'
|
89
|
-
http_version:
|
90
|
-
recorded_at: Thu, 26 Sep 2013 19:27:07 GMT
|
91
|
-
recorded_with: VCR 2.5.0
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://www.revtrunk.com/api/v1/inputs
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: !binary |-
|
9
|
+
iVBORw0KGgoAAAANSUhEUgAAAHMAAAAyCAYAAABvR+QvAAAGtklEQVR42u2c
|
10
|
+
z2scZRjH9w9QMxFBPEhHm7Smoe2ANGnamAxWqEqR9SIKoiOoeJIRc/Ako0gR
|
11
|
+
L4N48eTQowcdCAgWU6dumzSpttOiF0+DB3+kye5E/Bk1Xd/ZPKNvJzu77/O+
|
12
|
+
z0w2dA9fFtLu7Mz7eZ+f7ztvpdlsVjqpcWiocF1YnD8Gev7C4kLtRs2vMTUl
|
13
|
+
tZa53iz721ugGe53B8t4Thl148OrIgBTZ6oyORKymUyqB5u/GmpMJshicphc
|
14
|
+
poApZGoqKoJreXDt5DfMHQ8TIIRMTRKN7zm1OnXgoaIfngOewg4AkiroGK6V
|
15
|
+
QjZ2BEx2EYsM4la52zXLvzz9ycOLC+dmwPIoLLkJgF0ArHe7BzahB9nEfg7G
|
16
|
+
IUhVnxh5tSiYUYEwE3m9EpPAihNr88H6KFx1MlmszG8locrvMi4mKUx2AaNg
|
17
|
+
kKmsXkw4EvfJuWcVqK+3LPGB/Xewz88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|
49
|
+
headers:
|
50
|
+
Authorization:
|
51
|
+
- Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
|
52
|
+
User-Agent:
|
53
|
+
- RevOfficialRubySDK/1.0.0
|
54
|
+
Content-Disposition:
|
55
|
+
- attachment; filename="sourcedocument.png"
|
56
|
+
Content-Type:
|
57
|
+
- trololo
|
58
|
+
Accept:
|
59
|
+
- '*/*'
|
60
|
+
Content-Length:
|
61
|
+
- '1775'
|
62
|
+
response:
|
63
|
+
status:
|
64
|
+
code: 400
|
65
|
+
message: Bad Request
|
66
|
+
headers:
|
67
|
+
Cache-Control:
|
68
|
+
- no-cache
|
69
|
+
Pragma:
|
70
|
+
- no-cache
|
71
|
+
Content-Type:
|
72
|
+
- application/json; charset=utf-8
|
73
|
+
Expires:
|
74
|
+
- '-1'
|
75
|
+
Server:
|
76
|
+
- Microsoft-IIS/7.5
|
77
|
+
X-Miniprofiler-Ids:
|
78
|
+
- '["a0f9d7b5-d023-4b9a-9896-f0a2d64de3d3","bf2469f9-1da0-411e-bf13-d2536dad319c","8c9e9962-f48b-4ed4-98cc-418cd675a1ac","b9ff244c-b5cf-4df1-a46f-4ffcb1822ec2","28d29827-cb62-407b-a157-b5e219dcc576","d8efeedd-9de7-44b2-ba69-973527be9dbc","22d99839-4b04-495a-96cc-a5e0be8c9a12","2e4c73ef-12ed-464c-aa4f-4bb4ab398c00","3ea6619b-0c1f-4677-9613-0129cc504862","379bbb66-f74e-4d00-95bb-c6abfa4013a9","7a2148f2-ac1d-4822-bfbd-f4c6dc0cf201","77da68b5-42c7-4293-b229-98814a198f8b","3c434af1-18db-4612-b0ed-52147d4e2a5c","3b1e16e9-116e-44ed-b570-e25d0588544b","012dec81-c6a1-4518-a806-4ac3707e1fe9","066e3655-6a5d-40a4-8058-bfd2f07f93a7","20d23bf7-3b81-4012-ab14-4d972f573857","3d423fed-f62e-4f8c-96fb-5213ad3f0d6b"]'
|
79
|
+
X-Powered-By:
|
80
|
+
- ASP.NET
|
81
|
+
Date:
|
82
|
+
- Thu, 26 Sep 2013 19:27:07 GMT
|
83
|
+
Content-Length:
|
84
|
+
- '112'
|
85
|
+
body:
|
86
|
+
encoding: UTF-8
|
87
|
+
string: '{"code":10001,"message":"The content-type explicitly specified in the
|
88
|
+
request is not supported for input media"}'
|
89
|
+
http_version:
|
90
|
+
recorded_at: Thu, 26 Sep 2013 19:27:07 GMT
|
91
|
+
recorded_with: VCR 2.5.0
|
data/spec/lib/rev/api_spec.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe 'API Client' do
|
4
|
-
let(:client) { Rev.new('welcome', 'AAAAAu/YjZ3phXU5FsF35yIcgiA=', 'www.revtrunk.com') }
|
5
|
-
|
6
|
-
it 'must raise NotAuthorizedError on unauthorized HTTP response' do
|
7
|
-
VCR.insert_cassette 'unauthorized'
|
8
|
-
|
9
|
-
unauthorized_client = Rev.new('welcome', 'trololo', Rev::Api::SANDBOX_HOST)
|
10
|
-
action = lambda { unauthorized_client.get_orders_page }
|
11
|
-
action.must_raise Rev::NotAuthorizedError
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'must raise NotFoundError on NotFound HTTP response' do
|
15
|
-
VCR.insert_cassette 'not_found_order'
|
16
|
-
|
17
|
-
action = lambda { client.get_order('trololo') }
|
18
|
-
action.must_raise Rev::NotFoundError
|
19
|
-
end
|
20
|
-
|
21
|
-
after do
|
22
|
-
VCR.eject_cassette
|
23
|
-
end
|
24
|
-
end
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe 'API Client' do
|
4
|
+
let(:client) { Rev.new('welcome', 'AAAAAu/YjZ3phXU5FsF35yIcgiA=', 'www.revtrunk.com') }
|
5
|
+
|
6
|
+
it 'must raise NotAuthorizedError on unauthorized HTTP response' do
|
7
|
+
VCR.insert_cassette 'unauthorized'
|
8
|
+
|
9
|
+
unauthorized_client = Rev.new('welcome', 'trololo', Rev::Api::SANDBOX_HOST)
|
10
|
+
action = lambda { unauthorized_client.get_orders_page }
|
11
|
+
action.must_raise Rev::NotAuthorizedError
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'must raise NotFoundError on NotFound HTTP response' do
|
15
|
+
VCR.insert_cassette 'not_found_order'
|
16
|
+
|
17
|
+
action = lambda { client.get_order('trololo') }
|
18
|
+
action.must_raise Rev::NotFoundError
|
19
|
+
end
|
20
|
+
|
21
|
+
after do
|
22
|
+
VCR.eject_cassette
|
23
|
+
end
|
24
|
+
end
|