quaderno 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -6
- data/Gemfile.lock +8 -5
- data/README.md +7 -1
- data/VERSION +1 -1
- data/changelog.md +5 -0
- data/lib/quaderno-ruby/behavior/crud.rb +30 -36
- data/lib/quaderno-ruby/behavior/payment.rb +12 -19
- data/lib/quaderno-ruby/behavior/retrieve.rb +20 -0
- data/lib/quaderno-ruby/contact.rb +1 -0
- data/lib/quaderno-ruby/payment.rb +0 -2
- data/lib/quaderno-ruby/tax.rb +3 -3
- data/lib/quaderno-ruby/webhook.rb +0 -2
- data/lib/quaderno-ruby.rb +1 -1
- data/quaderno.gemspec +15 -3
- data/test/fixtures/quaderno_cassettes/all_contacts.yml +295 -31
- data/test/fixtures/quaderno_cassettes/all_estimates.yml +28 -36
- data/test/fixtures/quaderno_cassettes/all_expenses.yml +60 -34
- data/test/fixtures/quaderno_cassettes/all_invoices.yml +2888 -36
- data/test/fixtures/quaderno_cassettes/all_items.yml +22 -27
- data/test/fixtures/quaderno_cassettes/all_receipts.yml +56 -0
- data/test/fixtures/quaderno_cassettes/all_webhooks.yml +98 -126
- data/test/fixtures/quaderno_cassettes/calculate_tax.yml +38 -62
- data/test/fixtures/quaderno_cassettes/create_estimate_on_downgraded_API.yml +428 -0
- data/test/fixtures/quaderno_cassettes/create_expense_on_downgraded_API.yml +510 -0
- data/test/fixtures/quaderno_cassettes/create_invoice_on_downgraded_API.yml +432 -0
- data/test/fixtures/quaderno_cassettes/create_receipt_on_downgraded_API.yml +193 -0
- data/test/fixtures/quaderno_cassettes/deleted_contact.yml +642 -113
- data/test/fixtures/quaderno_cassettes/deleted_estimate.yml +385 -120
- data/test/fixtures/quaderno_cassettes/deleted_expense.yml +414 -118
- data/test/fixtures/quaderno_cassettes/deleted_invoice.yml +3249 -120
- data/test/fixtures/quaderno_cassettes/deleted_item.yml +60 -75
- data/test/fixtures/quaderno_cassettes/deleted_receipt.yml +222 -0
- data/test/fixtures/quaderno_cassettes/deleted_webhook.yml +120 -152
- data/test/fixtures/quaderno_cassettes/delivered_estimate.yml +76 -89
- data/test/fixtures/quaderno_cassettes/delivered_invoice.yml +2935 -89
- data/test/fixtures/quaderno_cassettes/delivered_receipt.yml +140 -0
- data/test/fixtures/quaderno_cassettes/found_contact.yml +319 -60
- data/test/fixtures/quaderno_cassettes/found_estimate.yml +53 -69
- data/test/fixtures/quaderno_cassettes/found_expense.yml +121 -65
- data/test/fixtures/quaderno_cassettes/found_invoice.yml +2916 -67
- data/test/fixtures/quaderno_cassettes/found_item.yml +50 -60
- data/test/fixtures/quaderno_cassettes/found_receipt.yml +101 -0
- data/test/fixtures/quaderno_cassettes/found_webhook.yml +60 -76
- data/test/fixtures/quaderno_cassettes/new_contact.yml +22 -29
- data/test/fixtures/quaderno_cassettes/new_estimate.yml +357 -84
- data/test/fixtures/quaderno_cassettes/new_expense.yml +414 -118
- data/test/fixtures/quaderno_cassettes/new_invoice.yml +361 -84
- data/test/fixtures/quaderno_cassettes/new_item.yml +22 -29
- data/test/fixtures/quaderno_cassettes/new_receipt.yml +169 -0
- data/test/fixtures/quaderno_cassettes/new_webhook.yml +38 -50
- data/test/fixtures/quaderno_cassettes/paid_expense.yml +79 -63
- data/test/fixtures/quaderno_cassettes/paid_invoice.yml +2907 -65
- data/test/fixtures/quaderno_cassettes/rate_limit.yml +22 -26
- data/test/fixtures/quaderno_cassettes/unpay_an_expense.yml +98 -85
- data/test/fixtures/quaderno_cassettes/unpay_an_invoice.yml +2926 -87
- data/test/fixtures/quaderno_cassettes/updated_contact.yml +318 -62
- data/test/fixtures/quaderno_cassettes/updated_estimate.yml +402 -116
- data/test/fixtures/quaderno_cassettes/updated_expense.yml +395 -113
- data/test/fixtures/quaderno_cassettes/updated_invoice.yml +410 -116
- data/test/fixtures/quaderno_cassettes/updated_item.yml +49 -61
- data/test/fixtures/quaderno_cassettes/updated_receipt.yml +214 -0
- data/test/fixtures/quaderno_cassettes/updated_webhook.yml +82 -105
- data/test/fixtures/quaderno_cassettes/wrong_token.yml +11 -25
- data/test/helper.rb +4 -0
- data/test/unit/test_quaderno_contacts.rb +18 -19
- data/test/unit/test_quaderno_estimates.rb +58 -31
- data/test/unit/test_quaderno_expenses.rb +68 -41
- data/test/unit/test_quaderno_invoices.rb +74 -47
- data/test/unit/test_quaderno_items.rb +27 -26
- data/test/unit/test_quaderno_receipts.rb +156 -0
- data/test/unit/test_quaderno_tax.rb +10 -10
- data/test/unit/test_quaderno_webhooks.rb +19 -20
- metadata +14 -2
@@ -2,49 +2,45 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/ping.json
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
+
accept:
|
11
|
+
- application/json
|
10
12
|
authorization:
|
11
|
-
- Basic
|
13
|
+
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
12
14
|
response:
|
13
15
|
status:
|
14
16
|
code: 200
|
15
17
|
message: OK
|
16
18
|
headers:
|
17
|
-
|
18
|
-
-
|
19
|
-
date:
|
20
|
-
- Tue, 01 Jul 2014 09:05:53 GMT
|
21
|
-
content-type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
transfer-encoding:
|
24
|
-
- chunked
|
25
|
-
connection:
|
26
|
-
- close
|
27
|
-
status:
|
28
|
-
- 200 OK
|
19
|
+
x-frame-options:
|
20
|
+
- ALLOWALL
|
29
21
|
x-ratelimit-limit:
|
30
22
|
- '2000'
|
23
|
+
x-ratelimit-reset:
|
24
|
+
- '8'
|
31
25
|
x-ratelimit-remaining:
|
32
|
-
- '
|
33
|
-
|
34
|
-
-
|
26
|
+
- '91'
|
27
|
+
content-type:
|
28
|
+
- application/json; charset=utf-8
|
35
29
|
etag:
|
36
|
-
-
|
30
|
+
- '"0c776997933eb60833b37beaf43814c8"'
|
37
31
|
cache-control:
|
38
|
-
-
|
32
|
+
- max-age=0, private, must-revalidate
|
39
33
|
x-request-id:
|
40
|
-
-
|
34
|
+
- 60c9ac78-9bac-409a-a15c-32939fa7792b
|
41
35
|
x-runtime:
|
42
|
-
- '0.
|
43
|
-
|
44
|
-
-
|
36
|
+
- '0.406134'
|
37
|
+
connection:
|
38
|
+
- close
|
39
|
+
server:
|
40
|
+
- thin
|
45
41
|
body:
|
46
|
-
encoding:
|
47
|
-
string:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"status":"OK"}'
|
48
44
|
http_version: '1.1'
|
49
|
-
recorded_at:
|
45
|
+
recorded_at: Thu, 23 Jun 2016 11:25:14 GMT
|
50
46
|
recorded_with: VCR 2.9.2
|
@@ -2,156 +2,169 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/expenses.json
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
+
accept:
|
11
|
+
- application/json
|
10
12
|
authorization:
|
11
|
-
- Basic
|
13
|
+
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
12
14
|
response:
|
13
15
|
status:
|
14
16
|
code: 200
|
15
17
|
message: OK
|
16
18
|
headers:
|
17
|
-
|
18
|
-
-
|
19
|
-
date:
|
20
|
-
- Tue, 01 Jul 2014 09:07:18 GMT
|
21
|
-
content-type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
transfer-encoding:
|
24
|
-
- chunked
|
25
|
-
connection:
|
26
|
-
- close
|
27
|
-
status:
|
28
|
-
- 200 OK
|
19
|
+
x-frame-options:
|
20
|
+
- ALLOWALL
|
29
21
|
x-ratelimit-limit:
|
30
22
|
- '2000'
|
23
|
+
x-ratelimit-reset:
|
24
|
+
- '9'
|
31
25
|
x-ratelimit-remaining:
|
32
|
-
- '
|
26
|
+
- '96'
|
33
27
|
x-pages-currentpage:
|
34
28
|
- '1'
|
35
29
|
x-pages-totalpages:
|
36
30
|
- '1'
|
37
|
-
|
38
|
-
-
|
31
|
+
content-type:
|
32
|
+
- application/json; charset=utf-8
|
39
33
|
etag:
|
40
|
-
-
|
34
|
+
- '"8d78811bffbec882d3a115c0c1cd55f7"'
|
41
35
|
cache-control:
|
42
|
-
-
|
36
|
+
- max-age=0, private, must-revalidate
|
43
37
|
x-request-id:
|
44
|
-
-
|
38
|
+
- f172b519-0a23-4e63-8954-11f322c65536
|
45
39
|
x-runtime:
|
46
|
-
- '0.
|
47
|
-
|
48
|
-
-
|
40
|
+
- '0.583619'
|
41
|
+
connection:
|
42
|
+
- close
|
43
|
+
server:
|
44
|
+
- thin
|
49
45
|
body:
|
50
|
-
encoding:
|
51
|
-
string: !
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
46
|
+
encoding: ASCII-8BIT
|
47
|
+
string: !binary |-
|
48
|
+
W3siaWQiOjk5NCwiaXNzdWVfZGF0ZSI6IjIwMTYtMDYtMDgiLCJjcmVhdGVk
|
49
|
+
X2F0IjoxNDY1Mzg1NjQwLCJjb250YWN0Ijp7ImlkIjo1MywiZnVsbF9uYW1l
|
50
|
+
IjoiVGVzdF9PQ1AgVW1wacOpcnJleiJ9LCJzdHJlZXRfbGluZV8xIjpudWxs
|
51
|
+
LCJzdHJlZXRfbGluZV8yIjpudWxsLCJjaXR5IjpudWxsLCJyZWdpb24iOm51
|
52
|
+
bGwsInBvc3RhbF9jb2RlIjpudWxsLCJwb19udW1iZXIiOm51bGwsImN1cnJl
|
53
|
+
bmN5IjoiRVVSIiwiZXhjaGFuZ2VfcmF0ZSI6IjEuMCIsIml0ZW1zIjpbeyJp
|
54
|
+
ZCI6MTAwNCwiZGVzY3JpcHRpb24iOiJ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L2V4cGVuc2VzLzk5NC5qc29uIn1d
|
60
86
|
http_version: '1.1'
|
61
|
-
recorded_at:
|
87
|
+
recorded_at: Thu, 23 Jun 2016 11:26:08 GMT
|
62
88
|
- request:
|
63
89
|
method: post
|
64
|
-
uri: http://
|
90
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/expenses/994/payments.json
|
65
91
|
body:
|
66
|
-
encoding:
|
92
|
+
encoding: UTF-8
|
67
93
|
string: payment_method=cash&amount=10000
|
68
94
|
headers:
|
95
|
+
accept:
|
96
|
+
- application/json
|
69
97
|
authorization:
|
70
|
-
- Basic
|
98
|
+
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
71
99
|
response:
|
72
100
|
status:
|
73
101
|
code: 201
|
74
102
|
message: Created
|
75
103
|
headers:
|
76
|
-
|
77
|
-
-
|
78
|
-
date:
|
79
|
-
- Tue, 01 Jul 2014 09:07:19 GMT
|
80
|
-
content-type:
|
81
|
-
- application/json; charset=utf-8
|
82
|
-
transfer-encoding:
|
83
|
-
- chunked
|
84
|
-
connection:
|
85
|
-
- close
|
86
|
-
status:
|
87
|
-
- 201 Created
|
104
|
+
x-frame-options:
|
105
|
+
- ALLOWALL
|
88
106
|
x-ratelimit-limit:
|
89
107
|
- '2000'
|
108
|
+
x-ratelimit-reset:
|
109
|
+
- '9'
|
90
110
|
x-ratelimit-remaining:
|
91
|
-
- '
|
92
|
-
|
93
|
-
-
|
111
|
+
- '95'
|
112
|
+
content-type:
|
113
|
+
- application/json; charset=utf-8
|
94
114
|
etag:
|
95
|
-
-
|
115
|
+
- '"c0351cb557968914dfd432cd00b19ae0"'
|
96
116
|
cache-control:
|
97
117
|
- max-age=0, private, must-revalidate
|
98
|
-
set-cookie:
|
99
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWZkMDkwOTY5ZmY3MjYwOTczOTlmOTE0NGY1MTY2NWFjBjsAVA%3D%3D--8a8720ed55cb31c7139096f515a035ea62cbbda2;
|
100
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
101
118
|
x-request-id:
|
102
|
-
-
|
119
|
+
- 257c763e-7e8f-43c1-8b77-a0b386a9d11d
|
103
120
|
x-runtime:
|
104
|
-
- '0.
|
105
|
-
|
106
|
-
-
|
121
|
+
- '0.917746'
|
122
|
+
connection:
|
123
|
+
- close
|
124
|
+
server:
|
125
|
+
- thin
|
107
126
|
body:
|
108
|
-
encoding:
|
109
|
-
string:
|
110
|
-
\u20ac","url":"http://uruk-1066.sandbox-quadernoapp.com/api/v1/expenses/492370/payments/328808.json"}'
|
127
|
+
encoding: UTF-8
|
128
|
+
string: '{"id":29,"date":"2016-06-23","payment_method":"cash","amount_cents":1000000,"url":"http://development.lvh.me:3000/api/expenses/994/payments/29.json"}'
|
111
129
|
http_version: '1.1'
|
112
|
-
recorded_at:
|
130
|
+
recorded_at: Thu, 23 Jun 2016 11:26:09 GMT
|
113
131
|
- request:
|
114
132
|
method: delete
|
115
|
-
uri: http://
|
133
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/expenses/994/payments/29.json
|
116
134
|
body:
|
117
135
|
encoding: US-ASCII
|
118
136
|
string: ''
|
119
137
|
headers:
|
138
|
+
accept:
|
139
|
+
- application/json
|
120
140
|
authorization:
|
121
|
-
- Basic
|
141
|
+
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
122
142
|
response:
|
123
143
|
status:
|
124
144
|
code: 204
|
125
145
|
message: No Content
|
126
146
|
headers:
|
127
|
-
|
128
|
-
-
|
129
|
-
date:
|
130
|
-
- Tue, 01 Jul 2014 09:07:19 GMT
|
131
|
-
connection:
|
132
|
-
- close
|
133
|
-
status:
|
134
|
-
- 204 No Content
|
147
|
+
x-frame-options:
|
148
|
+
- ALLOWALL
|
135
149
|
x-ratelimit-limit:
|
136
150
|
- '2000'
|
151
|
+
x-ratelimit-reset:
|
152
|
+
- '7'
|
137
153
|
x-ratelimit-remaining:
|
138
|
-
- '
|
139
|
-
x-ua-compatible:
|
140
|
-
- IE=Edge,chrome=1
|
154
|
+
- '94'
|
141
155
|
cache-control:
|
142
156
|
- no-cache
|
143
|
-
set-cookie:
|
144
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJThiMDY3Y2MzYWVjZWNmMDNhNzgxYzQ2OGUzOWI2MzIzBjsAVA%3D%3D--ca794873f9c264eb3e9dce84fb8ad4ef9c4a2926;
|
145
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
146
157
|
x-request-id:
|
147
|
-
-
|
158
|
+
- a7485ed1-8c25-4335-93ed-e04656afb2c0
|
148
159
|
x-runtime:
|
149
|
-
- '
|
150
|
-
|
151
|
-
-
|
160
|
+
- '1.215931'
|
161
|
+
connection:
|
162
|
+
- close
|
163
|
+
server:
|
164
|
+
- thin
|
152
165
|
body:
|
153
166
|
encoding: US-ASCII
|
154
167
|
string: ''
|
155
168
|
http_version: '1.1'
|
156
|
-
recorded_at:
|
169
|
+
recorded_at: Thu, 23 Jun 2016 11:26:10 GMT
|
157
170
|
recorded_with: VCR 2.9.2
|