quaderno 1.3.0 → 1.3.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.
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,177 +2,193 @@
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%2Fquadernoapp.com&events[]=created&events[]=updated
8
+ string: url=http%3A%2F%2Fquadernoapp.com&events_types[]=invoice.created&events_types[]=expense.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:32 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
- - '1837'
21
- content-type:
22
- - application/json; charset=utf-8
32
+ - '1487'
23
33
  x-ua-compatible:
24
- - IE=Edge
34
+ - IE=Edge,chrome=1
25
35
  etag:
26
- - ! '"7e50a0eca73c3a508c4c842a765cc91d"'
36
+ - ! '"7a435a86b4f498767f8f172a316fa246"'
27
37
  cache-control:
28
38
  - max-age=0, private, must-revalidate
39
+ set-cookie:
40
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTcyZjFjZGE0ZjhhMzBkY2Q1OWJkNTkwNTUzOTNiMWU2BjsAVA%3D%3D--cfbefb38862a4ed1b11dbff1432cd0ed5e765308;
41
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
29
42
  x-request-id:
30
- - 15ec241c0c2af6a9e4a2a628718c5cf9
43
+ - 55e9c6498572ff5ab59cc74778df220f
31
44
  x-runtime:
32
- - '2.314031'
33
- server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
35
- date:
36
- - Tue, 04 Feb 2014 14:53:37 GMT
37
- content-length:
38
- - '232'
39
- connection:
40
- - close
41
- set-cookie:
42
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTAyZDhmYzZjOWQ2N2M0ZmEyMDdkN2QxYzBmZTRlNTAxBjsAVA%3D%3D--a6107ef07ab1a67753855cee4cbe9de8774cef2d;
43
- path=/; HttpOnly
45
+ - '0.474994'
46
+ x-rack-cache:
47
+ - invalidate, pass
44
48
  body:
45
49
  encoding: US-ASCII
46
- string: ! '{"id":7,"url":"http://quadernoapp.com","auth_key":"3R6111PJWDSe-4poCP3HUg","events":["created","updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:37Z","updated_at":"2014-02-04T14:53:37Z"}'
50
+ string: ! '{"id":33,"url":"http://quadernoapp.com","auth_key":"0Up41agYU93UG3F-HMs2_w","events_types":["invoice.created","expense.updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:32Z","updated_at":"2014-06-13T12:34:32Z"}'
47
51
  http_version: '1.1'
48
- recorded_at: Tue, 04 Feb 2014 14:53:37 GMT
52
+ recorded_at: Fri, 13 Jun 2014 12:34:32 GMT
49
53
  - request:
50
54
  method: get
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
58
  string: ''
55
59
  headers:
56
60
  authorization:
57
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
61
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
58
62
  response:
59
63
  status:
60
64
  code: 200
61
- message: ! 'OK '
65
+ message: OK
62
66
  headers:
67
+ server:
68
+ - nginx/1.4.5
69
+ date:
70
+ - Fri, 13 Jun 2014 12:34:33 GMT
71
+ content-type:
72
+ - application/json; charset=utf-8
73
+ transfer-encoding:
74
+ - chunked
75
+ connection:
76
+ - close
77
+ status:
78
+ - 200 OK
63
79
  x-ratelimit-limit:
64
80
  - '2000'
65
81
  x-ratelimit-remaining:
66
- - '1836'
67
- content-type:
68
- - application/json; charset=utf-8
82
+ - '1486'
69
83
  x-ua-compatible:
70
- - IE=Edge
84
+ - IE=Edge,chrome=1
71
85
  etag:
72
- - ! '"9d99f68b2c5cea46cee072f1c3a4a086"'
86
+ - ! '"5afbefd9361340e2c470cca3e20cc6df"'
73
87
  cache-control:
74
- - max-age=0, private, must-revalidate
88
+ - must-revalidate, private, max-age=0
75
89
  x-request-id:
76
- - 6ee7d09f912fcf545aaf9f1ec0535ea2
90
+ - 4c068a31bb9927c0d12f82f773a6f69a
77
91
  x-runtime:
78
- - '0.339448'
79
- server:
80
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
81
- date:
82
- - Tue, 04 Feb 2014 14:53:37 GMT
83
- content-length:
84
- - '234'
85
- connection:
86
- - close
92
+ - '0.038278'
93
+ x-rack-cache:
94
+ - miss
87
95
  body:
88
96
  encoding: US-ASCII
89
- string: ! '[{"id":7,"url":"http://quadernoapp.com","auth_key":"3R6111PJWDSe-4poCP3HUg","events":["created","updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:37Z","updated_at":"2014-02-04T14:53:37Z"}]'
97
+ 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":33,"url":"http://quadernoapp.com","auth_key":"0Up41agYU93UG3F-HMs2_w","events_types":["invoice.created","expense.updated"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:32Z","updated_at":"2014-06-13T12:34:32Z"}]'
90
98
  http_version: '1.1'
91
- recorded_at: Tue, 04 Feb 2014 14:53:37 GMT
99
+ recorded_at: Fri, 13 Jun 2014 12:34:33 GMT
92
100
  - request:
93
101
  method: put
94
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/7.json
102
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks/33.json
95
103
  body:
96
104
  encoding: US-ASCII
97
- string: events[]=created&events[]=updated&events[]=deleted
105
+ string: events_types[]=invoice.created&events_types[]=invoice.updated&events_types[]=contact.deleted
98
106
  headers:
99
107
  authorization:
100
- - Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
108
+ - Basic a0FwcHNNZ2dHY3c4cHNVd2RaQlY6
101
109
  response:
102
110
  status:
103
111
  code: 200
104
- message: ! 'OK '
112
+ message: OK
105
113
  headers:
114
+ server:
115
+ - nginx/1.4.5
116
+ date:
117
+ - Fri, 13 Jun 2014 12:34:34 GMT
118
+ content-type:
119
+ - application/json; charset=utf-8
120
+ transfer-encoding:
121
+ - chunked
122
+ connection:
123
+ - close
124
+ status:
125
+ - 200 OK
106
126
  x-ratelimit-limit:
107
127
  - '2000'
108
128
  x-ratelimit-remaining:
109
- - '1835'
110
- content-type:
111
- - application/json; charset=utf-8
129
+ - '1485'
112
130
  x-ua-compatible:
113
- - IE=Edge
131
+ - IE=Edge,chrome=1
114
132
  etag:
115
- - ! '"96120f681b3f4d674e9ed3d4d2415326"'
133
+ - ! '"f9a406dca130df54550e19e1aa6d7486"'
116
134
  cache-control:
117
135
  - max-age=0, private, must-revalidate
136
+ set-cookie:
137
+ - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWY0ZDMzNWJlY2U4ZDVkOGVmN2IzMjA4ODBhNjUwZWJiBjsAVA%3D%3D--608805f55605e65d764f67688bd57f8027ab4ca4;
138
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
118
139
  x-request-id:
119
- - 6f6a25cf6aa5410df32ebd8a43226d5e
140
+ - f21d21b4eeb650a58b02c6e17ac41dfb
120
141
  x-runtime:
121
- - '2.094574'
122
- server:
123
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
124
- date:
125
- - Tue, 04 Feb 2014 14:53:39 GMT
126
- content-length:
127
- - '242'
128
- connection:
129
- - close
130
- set-cookie:
131
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTA3N2NkMjRiYzdiMGNhNGEzZDY4NTgyNjMxZmMyY2Y1BjsAVA%3D%3D--06e5b338d9e80848dc18a9eb4ac0e2e83a453ceb;
132
- path=/; HttpOnly
142
+ - '0.494142'
143
+ x-rack-cache:
144
+ - invalidate, pass
133
145
  body:
134
146
  encoding: US-ASCII
135
- string: ! '{"id":7,"url":"http://quadernoapp.com","auth_key":"3R6111PJWDSe-4poCP3HUg","events":["created","updated","deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-02-04T14:53:37Z","updated_at":"2014-02-04T14:53:39Z"}'
147
+ string: ! '{"id":33,"url":"http://quadernoapp.com","auth_key":"0Up41agYU93UG3F-HMs2_w","events_types":["invoice.created","invoice.updated","contact.deleted"],"last_sent_at":null,"last_error":null,"events_sent":0,"created_at":"2014-06-13T12:34:32Z","updated_at":"2014-06-13T12:34:34Z"}'
136
148
  http_version: '1.1'
137
- recorded_at: Tue, 04 Feb 2014 14:53:39 GMT
149
+ recorded_at: Fri, 13 Jun 2014 12:34:34 GMT
138
150
  - request:
139
151
  method: delete
140
- uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/7.json
152
+ uri: http://kAppsMggGcw8psUwdZBV@sandbox-quadernoapp.com/ninive-688/api/v1/webhooks/33.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:35 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
- - '1834'
175
+ - '1484'
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=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTliMDA2YjFkMGNhNGY5NjlkNTk3YTk2NzhmZjgwZjcwBjsAVA%3D%3D--c92e7fd3ef33d6a53a01a4021fceffa368090ea8;
182
+ domain=sandbox-quadernoapp.com; path=/; HttpOnly
160
183
  x-request-id:
161
- - 3620607b91bbc7d67072e8c97f8a7de8
184
+ - b2522b56ccb9cb0914e2aab36715d47f
162
185
  x-runtime:
163
- - '0.346585'
164
- server:
165
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
166
- date:
167
- - Tue, 04 Feb 2014 14:53:40 GMT
168
- connection:
169
- - close
170
- set-cookie:
171
- - _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTA4MDZmOTYwMjhmMTMzZTI2ZWY3NGY0YjhiM2FhYWZmBjsAVA%3D%3D--0738ff8612e7e7ee369998c721b71a4fd37a9f3c;
172
- path=/; HttpOnly
186
+ - '0.064576'
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:40 GMT
178
- recorded_with: VCR 2.3.0
193
+ recorded_at: Fri, 13 Jun 2014 12:34:35 GMT
194
+ recorded_with: VCR 2.9.2
@@ -5,10 +5,10 @@ class TestQuadernoContact < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
11
- end
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
+ end
12
12
  end
13
13
 
14
14
  should "get exception if pass wrong arguments" do
@@ -58,11 +58,7 @@ class TestQuadernoContact < Test::Unit::TestCase
58
58
  contacts = Quaderno::Contact.all
59
59
  contact = Quaderno::Contact.update(contacts[2].id, first_name: 'Test_OCP', email: 'dont@stop.believing')
60
60
  assert_kind_of Quaderno::Contact, contact
61
- if contact.kind == 'company'
62
- assert_equal 'Test_OCP', contact.full_name
63
- else
64
- assert_equal 'Test_OCP', contact.first_name
65
- end
61
+ assert_equal 'Test_OCP', contact.first_name || contact.full_name
66
62
  end
67
63
  end
68
64
 
@@ -5,9 +5,9 @@ class TestQuadernoEstimate < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
11
  end
12
12
  end
13
13
 
@@ -5,9 +5,9 @@ class TestQuadernoExpense < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
11
  end
12
12
  end
13
13
 
@@ -5,9 +5,9 @@ class TestQuadernoInvoice < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
11
  end
12
12
  end
13
13
 
@@ -5,9 +5,9 @@ class TestQuadernoItem < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
11
  end
12
12
  end
13
13
 
@@ -38,9 +38,9 @@ class TestQuadernoItem < Test::Unit::TestCase
38
38
  should "find an item" do
39
39
  VCR.use_cassette('found item') do
40
40
  items = Quaderno::Item.all
41
- item = Quaderno::Item.find items[2].id
41
+ item = Quaderno::Item.find items[1].id
42
42
  assert_kind_of Quaderno::Item, item
43
- assert_equal items[2].id, item.id
43
+ assert_equal items[1].id, item.id
44
44
  end
45
45
  end
46
46
 
@@ -56,7 +56,7 @@ class TestQuadernoItem < Test::Unit::TestCase
56
56
  should "update an item" do
57
57
  VCR.use_cassette('updated item') do
58
58
  items = Quaderno::Item.all
59
- item = Quaderno::Item.update(items[2].id, name: 'Test_OCP')
59
+ item = Quaderno::Item.update(items[1].id, name: 'Test_OCP')
60
60
  assert_kind_of Quaderno::Item, item
61
61
  assert_equal 'Test_OCP', item.name
62
62
  end
@@ -5,10 +5,10 @@ class TestQuadernoWebhook < Test::Unit::TestCase
5
5
 
6
6
  setup do
7
7
  Quaderno::Base.configure do |config|
8
- config.auth_token = '1spyno1mbqbp3SFpg9uT'
9
- config.subdomain = 'recrea'
10
- config.debug = true
11
- end
8
+ config.auth_token = 'kAppsMggGcw8psUwdZBV'
9
+ config.subdomain = 'ninive-688'
10
+ config.environment = :sandbox
11
+ end
12
12
  end
13
13
 
14
14
  should "get exception if pass wrong arguments" do
@@ -26,8 +26,8 @@ class TestQuadernoWebhook < Test::Unit::TestCase
26
26
 
27
27
  should "get all webhooks (populated db)" do
28
28
  VCR.use_cassette('all webhooks') do
29
- webhook_1 = Quaderno::Webhook.create(url: 'http://google.com', events: ['created', 'updated'])
30
- webhook_2 = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events: ['created', 'updated', 'deleted'])
29
+ webhook_1 = Quaderno::Webhook.create(url: 'http://google.com', events_types: ['invoice.created', 'invoice.updated'])
30
+ webhook_2 = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events_types: ['expense.created', 'expense.updated', 'contact.deleted'])
31
31
  webhooks = Quaderno::Webhook.all
32
32
  assert_not_nil webhooks
33
33
  assert_kind_of Array, webhooks
@@ -41,7 +41,7 @@ class TestQuadernoWebhook < Test::Unit::TestCase
41
41
 
42
42
  should "find a webhook" do
43
43
  VCR.use_cassette('found webhook') do
44
- webhook = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events: ['created', 'updated'])
44
+ webhook = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events_types: ['invoice.created', 'expense.updated'])
45
45
  webhooks = Quaderno::Webhook.all
46
46
  assert_kind_of Quaderno::Webhook, webhook
47
47
  assert_equal webhooks.last.id, webhook.id
@@ -51,29 +51,29 @@ class TestQuadernoWebhook < Test::Unit::TestCase
51
51
 
52
52
  should "create a webhook" do
53
53
  VCR.use_cassette('new webhook') do
54
- webhook = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events: ['created', 'updated'])
54
+ webhook = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events_types: ['invoice.created', 'expense.updated'])
55
55
  assert_kind_of Quaderno::Webhook, webhook
56
56
  assert_equal 'http://quadernoapp.com', webhook.url
57
- assert_equal ['created', 'updated'], webhook.events
57
+ assert_equal ['invoice.created', 'expense.updated'], webhook.events_types
58
58
  Quaderno::Webhook.delete webhook.id
59
59
  end
60
60
  end
61
61
 
62
62
  should "update a webhook" do
63
63
  VCR.use_cassette('updated webhook') do
64
- Quaderno::Webhook.create(url: 'http://quadernoapp.com', events: ['created', 'updated'])
64
+ Quaderno::Webhook.create(url: 'http://quadernoapp.com', events_types: ['invoice.created', 'expense.updated'])
65
65
  webhooks = Quaderno::Webhook.all
66
- webhook = Quaderno::Webhook.update(webhooks.last.id, events: ['created', 'updated', 'deleted'])
66
+ webhook = Quaderno::Webhook.update(webhooks.last.id, events_types: ['invoice.created', 'invoice.updated', 'contact.deleted'])
67
67
  assert_kind_of Quaderno::Webhook, webhook
68
- assert_equal ['created', 'updated', 'deleted'], webhook.events
68
+ assert_equal ['invoice.created', 'invoice.updated', 'contact.deleted'], webhook.events_types
69
69
  Quaderno::Webhook.delete webhook.id
70
70
  end
71
71
  end
72
72
 
73
73
  should "delete a webhook" do
74
74
  VCR.use_cassette('deleted webhook') do
75
- webhook_1 = Quaderno::Webhook.create(url: 'http://google.com', events: ['created', 'updated'])
76
- webhook_2 = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events: ['created', 'updated'])
75
+ webhook_1 = Quaderno::Webhook.create(url: 'http://google.com', events_types: ['invoice.created', 'expense.updated'])
76
+ webhook_2 = Quaderno::Webhook.create(url: 'http://quadernoapp.com', events_types: ['invoice.created', 'expense.updated'])
77
77
  webhooks_before = Quaderno::Webhook.all
78
78
  webhook_id = webhooks_before.last.id
79
79
  Quaderno::Webhook.delete webhook_id
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quaderno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recrea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.13.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.13.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,6 +84,8 @@ files:
84
84
  - lib/quaderno-ruby/payment.rb
85
85
  - lib/quaderno-ruby/webhook.rb
86
86
  - quaderno.gemspec
87
+ - test/fixtures/.DS_Store
88
+ - test/fixtures/quaderno_cassettes/.DS_Store
87
89
  - test/fixtures/quaderno_cassettes/all_contacts.yml
88
90
  - test/fixtures/quaderno_cassettes/all_estimates.yml
89
91
  - test/fixtures/quaderno_cassettes/all_expenses.yml
@@ -122,7 +124,6 @@ files:
122
124
  - test/fixtures/quaderno_cassettes/updated_item.yml
123
125
  - test/fixtures/quaderno_cassettes/updated_webhook.yml
124
126
  - test/helper.rb
125
- - test/test_quaderno-ruby.rb
126
127
  - test/unit/test_quaderno_contacts.rb
127
128
  - test/unit/test_quaderno_estimates.rb
128
129
  - test/unit/test_quaderno_expenses.rb
@@ -1,4 +0,0 @@
1
- require 'helper'
2
-
3
- class TestQuadernoContact < Test::Unit::TestCase
4
- end