quaderno 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile +3 -2
  3. data/Gemfile.lock +27 -22
  4. data/README.md +7 -2
  5. data/Rakefile +5 -6
  6. data/VERSION +1 -1
  7. data/build_install.sh +1 -1
  8. data/changelog.md +5 -0
  9. data/lib/quaderno-ruby/base.rb +24 -8
  10. data/lib/quaderno-ruby/behavior/crud.rb +5 -5
  11. data/lib/quaderno-ruby/behavior/deliver.rb +1 -1
  12. data/lib/quaderno-ruby/behavior/payment.rb +2 -2
  13. data/quaderno.gemspec +8 -7
  14. data/test/fixtures/.DS_Store +0 -0
  15. data/test/fixtures/quaderno_cassettes/.DS_Store +0 -0
  16. data/test/fixtures/quaderno_cassettes/all_contacts.yml +44 -26
  17. data/test/fixtures/quaderno_cassettes/all_estimates.yml +29 -37
  18. data/test/fixtures/quaderno_cassettes/all_expenses.yml +30 -40
  19. data/test/fixtures/quaderno_cassettes/all_invoices.yml +108 -36
  20. data/test/fixtures/quaderno_cassettes/all_items.yml +27 -23
  21. data/test/fixtures/quaderno_cassettes/all_webhooks.yml +124 -104
  22. data/test/fixtures/quaderno_cassettes/deleted_contact.yml +135 -92
  23. data/test/fixtures/quaderno_cassettes/deleted_estimate.yml +125 -105
  24. data/test/fixtures/quaderno_cassettes/deleted_expense.yml +126 -108
  25. data/test/fixtures/quaderno_cassettes/deleted_invoice.yml +203 -104
  26. data/test/fixtures/quaderno_cassettes/deleted_item.yml +74 -62
  27. data/test/fixtures/quaderno_cassettes/deleted_webhook.yml +149 -125
  28. data/test/fixtures/quaderno_cassettes/delivered_estimate.yml +75 -75
  29. data/test/fixtures/quaderno_cassettes/delivered_invoice.yml +159 -77
  30. data/test/fixtures/quaderno_cassettes/found_contact.yml +71 -49
  31. data/test/fixtures/quaderno_cassettes/found_estimate.yml +59 -64
  32. data/test/fixtures/quaderno_cassettes/found_expense.yml +61 -71
  33. data/test/fixtures/quaderno_cassettes/found_invoice.yml +145 -66
  34. data/test/fixtures/quaderno_cassettes/found_item.yml +54 -46
  35. data/test/fixtures/quaderno_cassettes/found_webhook.yml +75 -63
  36. data/test/fixtures/quaderno_cassettes/new_contact.yml +28 -24
  37. data/test/fixtures/quaderno_cassettes/new_estimate.yml +97 -69
  38. data/test/fixtures/quaderno_cassettes/new_expense.yml +126 -108
  39. data/test/fixtures/quaderno_cassettes/new_invoice.yml +96 -69
  40. data/test/fixtures/quaderno_cassettes/new_item.yml +28 -24
  41. data/test/fixtures/quaderno_cassettes/new_webhook.yml +50 -42
  42. data/test/fixtures/quaderno_cassettes/paid_expense.yml +57 -63
  43. data/test/fixtures/quaderno_cassettes/paid_invoice.yml +135 -59
  44. data/test/fixtures/quaderno_cassettes/rate_limit.yml +24 -20
  45. data/test/fixtures/quaderno_cassettes/unpay_an_expense.yml +79 -81
  46. data/test/fixtures/quaderno_cassettes/unpay_an_invoice.yml +157 -77
  47. data/test/fixtures/quaderno_cassettes/updated_contact.yml +71 -49
  48. data/test/fixtures/quaderno_cassettes/updated_estimate.yml +126 -94
  49. data/test/fixtures/quaderno_cassettes/updated_expense.yml +125 -93
  50. data/test/fixtures/quaderno_cassettes/updated_invoice.yml +125 -94
  51. data/test/fixtures/quaderno_cassettes/updated_item.yml +54 -46
  52. data/test/fixtures/quaderno_cassettes/updated_webhook.yml +103 -87
  53. data/test/unit/test_quaderno_contacts.rb +5 -9
  54. data/test/unit/test_quaderno_estimates.rb +3 -3
  55. data/test/unit/test_quaderno_expenses.rb +3 -3
  56. data/test/unit/test_quaderno_invoices.rb +3 -3
  57. data/test/unit/test_quaderno_items.rb +6 -6
  58. data/test/unit/test_quaderno_webhooks.rb +14 -14
  59. metadata +8 -7
  60. data/test/test_quaderno-ruby.rb +0 -4
@@ -2,217 +2,237 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks.json
5
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks.json
6
6
  body:
7
7
  encoding: US-ASCII
8
- string: url=http%3A%2F%2Fgoogle.com&events[]=created&events[]=updated
8
+ string: url=http%3A%2F%2Fgoogle.com&events_types[]=invoice.created&events_types[]=invoice.updated
9
9
  headers:
10
10
  authorization:
11
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
11
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
12
12
  response:
13
13
  status:
14
14
  code: 201
15
- message: ! 'Created '
15
+ message: Created
16
16
  headers:
17
+ server:
18
+ - nginx/1.4.5
19
+ date:
20
+ - Fri, 13 Jun 2014 12:34:28 GMT
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ transfer-encoding:
24
+ - chunked
25
+ connection:
26
+ - close
27
+ status:
28
+ - 201 Created
17
29
  x-ratelimit-limit:
18
30
  - '2000'
19
31
  x-ratelimit-remaining:
20
- - '1842'
21
- content-type:
22
- - application/json; charset=utf-8
32
+ - '1492'
23
33
  x-ua-compatible:
24
- - IE=Edge
34
+ - IE=Edge,chrome=1
25
35
  etag:
26
- - ! '"572568e82d8bb5c05d1da455dd2b68e9"'
36
+ - ! '"1b018226dfb9197f0a6abcdb56a49a7a"'
27
37
  cache-control:
28
38
  - max-age=0, private, must-revalidate
39
+ set-cookie:
40
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTMyMjdkYzM3YTliOThlNDhkZDljNmQ3NDZiYjMyNzM5BjsAVA%3D%3D--126cc4bb6c49d9547b8249feb07fd8029ad5d05d;
41
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
29
42
  x-request-id:
30
- - e650227db2fbde0c339be3cecde6306a
43
+ - b845e8588dc45643096112084aa5b429
31
44
  x-runtime:
32
- - '0.826650'
33
- server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
35
- date:
36
- - Tue, 04 Feb 2014 14:53:32 GMT
37
- content-length:
38
- - '227'
39
- connection:
40
- - close
41
- set-cookie:
42
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTY4NWY5ODE0NWQ0OTU4YWI1OWYzODYxZDViZWQzOTIxBjsAVA%3D%3D--febd7021d04b40d2c97d61edda5bdd5e038d5684;
43
- path=/; HttpOnly
45
+ - '0.263191'
46
+ x-rack-cache:
47
+ - invalidate, pass
44
48
  body:
45
49
  encoding: US-ASCII
46
- string: ! '{"id":5,"url":"http://google.com","auth_key":"okItwHLl4ohTN56GAjasjw","events":["created","updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:32Z","updated_at":"2014-02-04T14:53:32Z"}'
50
+ string: ! '{"id":31,"url":"http://google.com","auth_key":"yb2e3cFegrOV1dG9JZxcvg","events_types":["invoice.created","invoice.updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:28Z","updated_at":"2014-06-13T12:34:28Z"}'
47
51
  http_version: '1.1'
48
- recorded_at: Tue, 04 Feb 2014 14:53:32 GMT
52
+ recorded_at: Fri, 13 Jun 2014 12:34:28 GMT
49
53
  - request:
50
54
  method: post
51
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks.json
55
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks.json
52
56
  body:
53
57
  encoding: US-ASCII
54
- string: url=http%3A%2F%2Fquadernoapp.com&events[]=created&events[]=updated&events[]=deleted
58
+ string: url=http%3A%2F%2Fquadernoapp.com&events_types[]=expense.created&events_types[]=expense.updated&events_types[]=contact.deleted
55
59
  headers:
56
60
  authorization:
57
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
61
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
58
62
  response:
59
63
  status:
60
64
  code: 201
61
- message: ! 'Created '
65
+ message: Created
62
66
  headers:
67
+ server:
68
+ - nginx/1.4.5
69
+ date:
70
+ - Fri, 13 Jun 2014 12:34:29 GMT
71
+ content-type:
72
+ - application/json; charset=utf-8
73
+ transfer-encoding:
74
+ - chunked
75
+ connection:
76
+ - close
77
+ status:
78
+ - 201 Created
63
79
  x-ratelimit-limit:
64
80
  - '2000'
65
81
  x-ratelimit-remaining:
66
- - '1841'
67
- content-type:
68
- - application/json; charset=utf-8
82
+ - '1491'
69
83
  x-ua-compatible:
70
- - IE=Edge
84
+ - IE=Edge,chrome=1
71
85
  etag:
72
- - ! '"a622eca95492185f1fb74efcc0f53d22"'
86
+ - ! '"bfc1bf966e1335580804a4e3163e756f"'
73
87
  cache-control:
74
88
  - max-age=0, private, must-revalidate
89
+ set-cookie:
90
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTJhZDk1Njk3OTM2YjYzOGNlZGU3MDk3Nzk0N2Y5Y2FmBjsAVA%3D%3D--329566d674bf5ab5a66157cb559c28d8dd16cab5;
91
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
75
92
  x-request-id:
76
- - cd7baddf2b4494ba7e4b0998d26e9974
93
+ - 91dd2c90662c503543c1c6409c802e01
77
94
  x-runtime:
78
- - '2.253129'
79
- server:
80
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
81
- date:
82
- - Tue, 04 Feb 2014 14:53:34 GMT
83
- content-length:
84
- - '242'
85
- connection:
86
- - close
87
- set-cookie:
88
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWU1NTcxNGMzYmU0MWRmYzJiMjY3ZWY4OGY2MzE3NGE4BjsAVA%3D%3D--493a9a145278d56bb7de2b86115e4c34e4341627;
89
- path=/; HttpOnly
95
+ - '0.813012'
96
+ x-rack-cache:
97
+ - invalidate, pass
90
98
  body:
91
99
  encoding: US-ASCII
92
- string: ! '{"id":6,"url":"http://quadernoapp.com","auth_key":"G3q7IziH6KT-FQs6-QYy1Q","events":["created","updated","deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:34Z","updated_at":"2014-02-04T14:53:34Z"}'
100
+ string: ! '{"id":32,"url":"http://quadernoapp.com","auth_key":"BF4TOv35AkXHWHTwyqOSDg","events_types":["expense.created","expense.updated","contact.deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:29Z","updated_at":"2014-06-13T12:34:29Z"}'
93
101
  http_version: '1.1'
94
- recorded_at: Tue, 04 Feb 2014 14:53:34 GMT
102
+ recorded_at: Fri, 13 Jun 2014 12:34:29 GMT
95
103
  - request:
96
104
  method: get
97
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks.json
105
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks.json
98
106
  body:
99
107
  encoding: US-ASCII
100
108
  string: ''
101
109
  headers:
102
110
  authorization:
103
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
111
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
104
112
  response:
105
113
  status:
106
114
  code: 200
107
- message: ! 'OK '
115
+ message: OK
108
116
  headers:
117
+ server:
118
+ - nginx/1.4.5
119
+ date:
120
+ - Fri, 13 Jun 2014 12:34:30 GMT
121
+ content-type:
122
+ - application/json; charset=utf-8
123
+ transfer-encoding:
124
+ - chunked
125
+ connection:
126
+ - close
127
+ status:
128
+ - 200 OK
109
129
  x-ratelimit-limit:
110
130
  - '2000'
111
131
  x-ratelimit-remaining:
112
- - '1840'
113
- content-type:
114
- - application/json; charset=utf-8
132
+ - '1490'
115
133
  x-ua-compatible:
116
- - IE=Edge
134
+ - IE=Edge,chrome=1
117
135
  etag:
118
- - ! '"94fd95c57bd64f0a184f6b7a495fe76a"'
136
+ - ! '"6b76c7ab82dd4fa67bb4653e77976a7f"'
119
137
  cache-control:
120
- - max-age=0, private, must-revalidate
138
+ - must-revalidate, private, max-age=0
121
139
  x-request-id:
122
- - 2cd66834dcdc7bd9b8bac591c04e7e91
140
+ - f0e5fa3217c2ba525bbb008689589ca3
123
141
  x-runtime:
124
- - '0.135322'
125
- server:
126
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
127
- date:
128
- - Tue, 04 Feb 2014 14:53:34 GMT
129
- content-length:
130
- - '472'
131
- connection:
132
- - close
142
+ - '0.074528'
143
+ x-rack-cache:
144
+ - miss
133
145
  body:
134
146
  encoding: US-ASCII
135
- string: ! '[{"id":5,"url":"http://google.com","auth_key":"okItwHLl4ohTN56GAjasjw","events":["created","updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:32Z","updated_at":"2014-02-04T14:53:32Z"},{"id":6,"url":"http://quadernoapp.com","auth_key":"G3q7IziH6KT-FQs6-QYy1Q","events":["created","updated","deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:34Z","updated_at":"2014-02-04T14:53:34Z"}]'
147
+ string: ! '[{"id":6,"url":"http://quadernoapp.com","auth_key":"ebL7LVbbJBVOwMSZCQz75A","events_types":["invoice.created","expense.updated"],"last_sent_at":"2014-06-13T12:29:43Z","last_error":null,"events_sent":7,"created_at":"2014-06-13T12:09:20Z","updated_at":"2014-06-13T12:09:20Z"},{"id":12,"url":"http://quadernoapp.com","auth_key":"CyZRqDK-ypNmYYeL0l1B0Q","events_types":["invoice.created","invoice.updated","contact.deleted"],"last_sent_at":"2014-06-13T12:33:03Z","last_error":null,"events_sent":16,"created_at":"2014-06-13T12:09:32Z","updated_at":"2014-06-13T12:09:34Z"},{"id":31,"url":"http://google.com","auth_key":"yb2e3cFegrOV1dG9JZxcvg","events_types":["invoice.created","invoice.updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:28Z","updated_at":"2014-06-13T12:34:28Z"},{"id":32,"url":"http://quadernoapp.com","auth_key":"BF4TOv35AkXHWHTwyqOSDg","events_types":["expense.created","expense.updated","contact.deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:29Z","updated_at":"2014-06-13T12:34:29Z"}]'
136
148
  http_version: '1.1'
137
- recorded_at: Tue, 04 Feb 2014 14:53:34 GMT
149
+ recorded_at: Fri, 13 Jun 2014 12:34:30 GMT
138
150
  - request:
139
151
  method: delete
140
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/5.json
152
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks/31.json
141
153
  body:
142
154
  encoding: US-ASCII
143
155
  string: ''
144
156
  headers:
145
157
  authorization:
146
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
158
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
147
159
  response:
148
160
  status:
149
161
  code: 204
150
- message: ! 'No Content '
162
+ message: No Content
151
163
  headers:
164
+ server:
165
+ - nginx/1.4.5
166
+ date:
167
+ - Fri, 13 Jun 2014 12:34:30 GMT
168
+ connection:
169
+ - close
170
+ status:
171
+ - 204 No Content
152
172
  x-ratelimit-limit:
153
173
  - '2000'
154
174
  x-ratelimit-remaining:
155
- - '1839'
175
+ - '1489'
156
176
  x-ua-compatible:
157
- - IE=Edge
177
+ - IE=Edge,chrome=1
158
178
  cache-control:
159
179
  - no-cache
180
+ set-cookie:
181
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWI4MDEyYTUxYTRhYzJlYTcyZjUxNWM4ZGQ0OWNhMWNhBjsAVA%3D%3D--6e24cc95b5171e9e98273893da850beb974a86a4;
182
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
160
183
  x-request-id:
161
- - 1c04ef9a384aff3289ed0465ee6d8232
184
+ - 90b82aee257ad06a11b38b8bcd9bda63
162
185
  x-runtime:
163
- - '0.101120'
164
- server:
165
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
166
- date:
167
- - Tue, 04 Feb 2014 14:53:34 GMT
168
- connection:
169
- - close
170
- set-cookie:
171
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTFjYjE4NGQ1ZTEwNTVlZThjZDE5NDczZjE3ZjMwOTYzBjsAVA%3D%3D--25f862316ea069a3ca7e99aea63357f73ae5b6c6;
172
- path=/; HttpOnly
186
+ - '0.066085'
187
+ x-rack-cache:
188
+ - invalidate, pass
173
189
  body:
174
190
  encoding: US-ASCII
175
191
  string: ''
176
192
  http_version: '1.1'
177
- recorded_at: Tue, 04 Feb 2014 14:53:34 GMT
193
+ recorded_at: Fri, 13 Jun 2014 12:34:30 GMT
178
194
  - request:
179
195
  method: delete
180
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/6.json
196
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks/32.json
181
197
  body:
182
198
  encoding: US-ASCII
183
199
  string: ''
184
200
  headers:
185
201
  authorization:
186
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
202
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
187
203
  response:
188
204
  status:
189
205
  code: 204
190
- message: ! 'No Content '
206
+ message: No Content
191
207
  headers:
208
+ server:
209
+ - nginx/1.4.5
210
+ date:
211
+ - Fri, 13 Jun 2014 12:34:31 GMT
212
+ connection:
213
+ - close
214
+ status:
215
+ - 204 No Content
192
216
  x-ratelimit-limit:
193
217
  - '2000'
194
218
  x-ratelimit-remaining:
195
- - '1838'
219
+ - '1488'
196
220
  x-ua-compatible:
197
- - IE=Edge
221
+ - IE=Edge,chrome=1
198
222
  cache-control:
199
223
  - no-cache
224
+ set-cookie:
225
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWFiYzFiMzc4MGFlZGU5OGEyMzcwNjM4MDcyYzY5ODE5BjsAVA%3D%3D--ad06c3ce72953f269cf29cb7911635cd6a8eae85;
226
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
200
227
  x-request-id:
201
- - 2ed7a47c1dd73d6934ff6a3a6979f1a7
228
+ - 85bcfc897207a8d4a5363e1e532a7f83
202
229
  x-runtime:
203
- - '0.321013'
204
- server:
205
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
206
- date:
207
- - Tue, 04 Feb 2014 14:53:34 GMT
208
- connection:
209
- - close
210
- set-cookie:
211
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTA5ZDA1OGIwNjVhNjkzNTM4MTIyNTA4OTQ2MDdlNzIzBjsAVA%3D%3D--8f401b0afa66d88c0cca2f20d71522456ef60665;
212
- path=/; HttpOnly
230
+ - '0.064684'
231
+ x-rack-cache:
232
+ - invalidate, pass
213
233
  body:
214
234
  encoding: US-ASCII
215
235
  string: ''
216
236
  http_version: '1.1'
217
- recorded_at: Tue, 04 Feb 2014 14:53:34 GMT
218
- recorded_with: VCR 2.3.0
237
+ recorded_at: Fri, 13 Jun 2014 12:34:31 GMT
238
+ recorded_with: VCR 2.9.2