quaderno 1.2.1 → 1.2.2
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.
- data/Gemfile +6 -7
- data/Gemfile.lock +0 -9
- data/README.md +6 -2
- data/VERSION +1 -1
- data/build_install.sh +1 -1
- data/changelog.md +4 -0
- data/lib/quaderno-ruby/base.rb +10 -2
- data/lib/quaderno-ruby/behavior/crud.rb +0 -1
- data/lib/quaderno-ruby.rb +0 -2
- data/quaderno.gemspec +6 -25
- data/test/fixtures/quaderno_cassettes/all_contacts.yml +23 -18
- data/test/fixtures/quaderno_cassettes/all_estimates.yml +35 -18
- data/test/fixtures/quaderno_cassettes/all_expenses.yml +38 -18
- data/test/fixtures/quaderno_cassettes/all_invoices.yml +35 -29
- data/test/fixtures/quaderno_cassettes/all_items.yml +17 -12
- data/test/fixtures/quaderno_cassettes/all_webhooks.yml +84 -68
- data/test/fixtures/quaderno_cassettes/deleted_contact.yml +81 -62
- data/test/fixtures/quaderno_cassettes/deleted_estimate.yml +96 -62
- data/test/fixtures/quaderno_cassettes/deleted_expense.yml +99 -62
- data/test/fixtures/quaderno_cassettes/deleted_invoice.yml +96 -73
- data/test/fixtures/quaderno_cassettes/deleted_item.yml +49 -37
- data/test/fixtures/quaderno_cassettes/deleted_webhook.yml +100 -80
- data/test/fixtures/quaderno_cassettes/delivered_estimate.yml +66 -45
- data/test/fixtures/quaderno_cassettes/delivered_invoice.yml +66 -56
- data/test/fixtures/quaderno_cassettes/found_contact.yml +39 -30
- data/test/fixtures/quaderno_cassettes/found_estimate.yml +55 -32
- data/test/fixtures/quaderno_cassettes/found_expense.yml +62 -30
- data/test/fixtures/quaderno_cassettes/found_invoice.yml +58 -42
- data/test/fixtures/quaderno_cassettes/found_item.yml +33 -24
- data/test/fixtures/quaderno_cassettes/found_webhook.yml +50 -40
- data/test/fixtures/quaderno_cassettes/new_contact.yml +19 -12
- data/test/fixtures/quaderno_cassettes/new_estimate.yml +61 -44
- data/test/fixtures/quaderno_cassettes/new_expense.yml +99 -62
- data/test/fixtures/quaderno_cassettes/new_invoice.yml +61 -44
- data/test/fixtures/quaderno_cassettes/new_item.yml +19 -12
- data/test/fixtures/quaderno_cassettes/new_webhook.yml +34 -28
- data/test/fixtures/quaderno_cassettes/paid_expense.yml +57 -30
- data/test/fixtures/quaderno_cassettes/paid_invoice.yml +54 -41
- data/test/fixtures/quaderno_cassettes/rate_limit.yml +14 -10
- data/test/fixtures/quaderno_cassettes/unpay_an_expense.yml +73 -43
- data/test/fixtures/quaderno_cassettes/unpay_an_invoice.yml +70 -54
- data/test/fixtures/quaderno_cassettes/updated_contact.yml +42 -30
- data/test/fixtures/quaderno_cassettes/updated_estimate.yml +84 -57
- data/test/fixtures/quaderno_cassettes/updated_expense.yml +81 -56
- data/test/fixtures/quaderno_cassettes/updated_invoice.yml +84 -57
- data/test/fixtures/quaderno_cassettes/updated_item.yml +36 -24
- data/test/fixtures/quaderno_cassettes/updated_webhook.yml +69 -55
- data/test/helper.rb +12 -12
- data/test/unit/test_quaderno_contacts.rb +4 -3
- data/test/unit/test_quaderno_estimates.rb +2 -1
- data/test/unit/test_quaderno_expenses.rb +3 -2
- data/test/unit/test_quaderno_invoices.rb +3 -2
- data/test/unit/test_quaderno_items.rb +4 -3
- data/test/unit/test_quaderno_webhooks.rb +4 -3
- metadata +10 -94
- data/quaderno-1.0.0.gem +0 -0
- data/quaderno-1.1.0.gem +0 -0
- data/quaderno-1.1.2.gem +0 -0
- data/quaderno-1.2.0.gem +0 -0
|
@@ -2,80 +2,92 @@
|
|
|
2
2
|
http_interactions:
|
|
3
3
|
- request:
|
|
4
4
|
method: get
|
|
5
|
-
uri: http://
|
|
5
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/items.json
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
8
|
string: ''
|
|
9
9
|
headers:
|
|
10
10
|
authorization:
|
|
11
|
-
- Basic
|
|
11
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
12
12
|
response:
|
|
13
13
|
status:
|
|
14
14
|
code: 200
|
|
15
|
-
message: OK
|
|
15
|
+
message: ! 'OK '
|
|
16
16
|
headers:
|
|
17
17
|
x-ratelimit-limit:
|
|
18
|
-
- '
|
|
18
|
+
- '2000'
|
|
19
19
|
x-ratelimit-remaining:
|
|
20
|
-
- '
|
|
20
|
+
- '1855'
|
|
21
21
|
content-type:
|
|
22
22
|
- application/json; charset=utf-8
|
|
23
23
|
x-ua-compatible:
|
|
24
24
|
- IE=Edge
|
|
25
25
|
etag:
|
|
26
|
-
- ! '"
|
|
26
|
+
- ! '"bcea0893565ac5c95d5dae6164a7cad8"'
|
|
27
27
|
cache-control:
|
|
28
28
|
- max-age=0, private, must-revalidate
|
|
29
29
|
x-request-id:
|
|
30
|
-
-
|
|
30
|
+
- 7d3de84684ae3582772412270cd60ad1
|
|
31
31
|
x-runtime:
|
|
32
|
-
- '0.
|
|
32
|
+
- '0.381205'
|
|
33
|
+
server:
|
|
34
|
+
- WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
|
|
35
|
+
date:
|
|
36
|
+
- Tue, 04 Feb 2014 14:52:22 GMT
|
|
37
|
+
content-length:
|
|
38
|
+
- '451'
|
|
33
39
|
connection:
|
|
34
40
|
- close
|
|
35
|
-
server:
|
|
36
|
-
- thin 1.5.0 codename Knife
|
|
37
41
|
body:
|
|
38
42
|
encoding: US-ASCII
|
|
39
|
-
string: ! '[{"id":
|
|
43
|
+
string: ! '[{"id":1,"code":"00001","name":"Fritata","unit_cost":"20.0","tax_1_name":"IVA","tax_1_rate":21.0,"url":"http://localhost:3000/recrea/api/v1/items/1"},{"id":3,"code":"NaN00","name":"Nan
|
|
44
|
+
Kima","unit_cost":"2.35","tax_1_name":"IVA","tax_1_rate":21.0,"url":"http://localhost:3000/recrea/api/v1/items/3"},{"id":2,"code":"000017","name":"Pizzata","unit_cost":"25.99","tax_1_name":"IVA","tax_1_rate":21.0,"url":"http://localhost:3000/recrea/api/v1/items/2"}]'
|
|
40
45
|
http_version: '1.1'
|
|
41
|
-
recorded_at: Tue,
|
|
46
|
+
recorded_at: Tue, 04 Feb 2014 14:52:22 GMT
|
|
42
47
|
- request:
|
|
43
48
|
method: put
|
|
44
|
-
uri: http://
|
|
49
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/items/2.json
|
|
45
50
|
body:
|
|
46
51
|
encoding: US-ASCII
|
|
47
52
|
string: name=Test_OCP
|
|
48
53
|
headers:
|
|
49
54
|
authorization:
|
|
50
|
-
- Basic
|
|
55
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
51
56
|
response:
|
|
52
57
|
status:
|
|
53
58
|
code: 200
|
|
54
|
-
message: OK
|
|
59
|
+
message: ! 'OK '
|
|
55
60
|
headers:
|
|
56
61
|
x-ratelimit-limit:
|
|
57
|
-
- '
|
|
62
|
+
- '2000'
|
|
58
63
|
x-ratelimit-remaining:
|
|
59
|
-
- '
|
|
64
|
+
- '1854'
|
|
60
65
|
content-type:
|
|
61
66
|
- application/json; charset=utf-8
|
|
62
67
|
x-ua-compatible:
|
|
63
68
|
- IE=Edge
|
|
64
69
|
etag:
|
|
65
|
-
- ! '"
|
|
70
|
+
- ! '"fad25d508433bb4f2bc087d6a2a5545e"'
|
|
66
71
|
cache-control:
|
|
67
72
|
- max-age=0, private, must-revalidate
|
|
68
73
|
x-request-id:
|
|
69
|
-
-
|
|
74
|
+
- faec2eb816556a17ef72fcd379d0a349
|
|
70
75
|
x-runtime:
|
|
71
|
-
- '0.
|
|
76
|
+
- '0.139602'
|
|
77
|
+
server:
|
|
78
|
+
- WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
|
|
79
|
+
date:
|
|
80
|
+
- Tue, 04 Feb 2014 14:52:22 GMT
|
|
81
|
+
content-length:
|
|
82
|
+
- '151'
|
|
72
83
|
connection:
|
|
73
84
|
- close
|
|
74
|
-
|
|
75
|
-
-
|
|
85
|
+
set-cookie:
|
|
86
|
+
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWNhMDczNWQ0ZWYwMWIwYjkwZDU2MjE2YmIxZmRmZDE1BjsAVA%3D%3D--442e44d3bc449fac8b51a8a6373e689bcf9554cf;
|
|
87
|
+
path=/; HttpOnly
|
|
76
88
|
body:
|
|
77
89
|
encoding: US-ASCII
|
|
78
|
-
string: ! '{"id":
|
|
90
|
+
string: ! '{"id":2,"code":"000017","name":"Test_OCP","unit_cost":"25.99","tax_1_name":"IVA","tax_1_rate":21.0,"url":"http://localhost:3000/recrea/api/v1/items/2"}'
|
|
79
91
|
http_version: '1.1'
|
|
80
|
-
recorded_at: Tue,
|
|
92
|
+
recorded_at: Tue, 04 Feb 2014 14:52:22 GMT
|
|
81
93
|
recorded_with: VCR 2.3.0
|
|
@@ -2,163 +2,177 @@
|
|
|
2
2
|
http_interactions:
|
|
3
3
|
- request:
|
|
4
4
|
method: post
|
|
5
|
-
uri: http://
|
|
5
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks.json
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
8
|
string: url=http%3A%2F%2Fquadernoapp.com&events[]=created&events[]=updated
|
|
9
9
|
headers:
|
|
10
10
|
authorization:
|
|
11
|
-
- Basic
|
|
11
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
12
12
|
response:
|
|
13
13
|
status:
|
|
14
14
|
code: 201
|
|
15
|
-
message: Created
|
|
15
|
+
message: ! 'Created '
|
|
16
16
|
headers:
|
|
17
17
|
x-ratelimit-limit:
|
|
18
|
-
- '
|
|
18
|
+
- '2000'
|
|
19
19
|
x-ratelimit-remaining:
|
|
20
|
-
- '
|
|
20
|
+
- '1837'
|
|
21
21
|
content-type:
|
|
22
22
|
- application/json; charset=utf-8
|
|
23
23
|
x-ua-compatible:
|
|
24
24
|
- IE=Edge
|
|
25
25
|
etag:
|
|
26
|
-
- ! '"
|
|
26
|
+
- ! '"7e50a0eca73c3a508c4c842a765cc91d"'
|
|
27
27
|
cache-control:
|
|
28
28
|
- max-age=0, private, must-revalidate
|
|
29
|
-
set-cookie:
|
|
30
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWE4MzEzYzI1YjU3M2MwZmEyMThlOWFkYjUyYWY2ODgwBjsAVA%3D%3D--7ec0cb3dc0e6506c57834b8b9e7f83a53de5a854;
|
|
31
|
-
path=/; HttpOnly
|
|
32
29
|
x-request-id:
|
|
33
|
-
-
|
|
30
|
+
- 15ec241c0c2af6a9e4a2a628718c5cf9
|
|
34
31
|
x-runtime:
|
|
35
|
-
- '
|
|
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'
|
|
36
39
|
connection:
|
|
37
40
|
- close
|
|
38
|
-
|
|
39
|
-
-
|
|
41
|
+
set-cookie:
|
|
42
|
+
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTAyZDhmYzZjOWQ2N2M0ZmEyMDdkN2QxYzBmZTRlNTAxBjsAVA%3D%3D--a6107ef07ab1a67753855cee4cbe9de8774cef2d;
|
|
43
|
+
path=/; HttpOnly
|
|
40
44
|
body:
|
|
41
45
|
encoding: US-ASCII
|
|
42
|
-
string: ! '{"id":
|
|
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"}'
|
|
43
47
|
http_version: '1.1'
|
|
44
|
-
recorded_at:
|
|
48
|
+
recorded_at: Tue, 04 Feb 2014 14:53:37 GMT
|
|
45
49
|
- request:
|
|
46
50
|
method: get
|
|
47
|
-
uri: http://
|
|
51
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks.json
|
|
48
52
|
body:
|
|
49
53
|
encoding: US-ASCII
|
|
50
54
|
string: ''
|
|
51
55
|
headers:
|
|
52
56
|
authorization:
|
|
53
|
-
- Basic
|
|
57
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
54
58
|
response:
|
|
55
59
|
status:
|
|
56
60
|
code: 200
|
|
57
|
-
message: OK
|
|
61
|
+
message: ! 'OK '
|
|
58
62
|
headers:
|
|
59
63
|
x-ratelimit-limit:
|
|
60
|
-
- '
|
|
64
|
+
- '2000'
|
|
61
65
|
x-ratelimit-remaining:
|
|
62
|
-
- '
|
|
66
|
+
- '1836'
|
|
63
67
|
content-type:
|
|
64
68
|
- application/json; charset=utf-8
|
|
65
69
|
x-ua-compatible:
|
|
66
70
|
- IE=Edge
|
|
67
71
|
etag:
|
|
68
|
-
- ! '"
|
|
72
|
+
- ! '"9d99f68b2c5cea46cee072f1c3a4a086"'
|
|
69
73
|
cache-control:
|
|
70
74
|
- max-age=0, private, must-revalidate
|
|
71
75
|
x-request-id:
|
|
72
|
-
-
|
|
76
|
+
- 6ee7d09f912fcf545aaf9f1ec0535ea2
|
|
73
77
|
x-runtime:
|
|
74
|
-
- '0.
|
|
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'
|
|
75
85
|
connection:
|
|
76
86
|
- close
|
|
77
|
-
server:
|
|
78
|
-
- thin 1.5.0 codename Knife
|
|
79
87
|
body:
|
|
80
88
|
encoding: US-ASCII
|
|
81
|
-
string: ! '[{"id":
|
|
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"}]'
|
|
82
90
|
http_version: '1.1'
|
|
83
|
-
recorded_at:
|
|
91
|
+
recorded_at: Tue, 04 Feb 2014 14:53:37 GMT
|
|
84
92
|
- request:
|
|
85
93
|
method: put
|
|
86
|
-
uri: http://
|
|
94
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/7.json
|
|
87
95
|
body:
|
|
88
96
|
encoding: US-ASCII
|
|
89
97
|
string: events[]=created&events[]=updated&events[]=deleted
|
|
90
98
|
headers:
|
|
91
99
|
authorization:
|
|
92
|
-
- Basic
|
|
100
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
93
101
|
response:
|
|
94
102
|
status:
|
|
95
103
|
code: 200
|
|
96
|
-
message: OK
|
|
104
|
+
message: ! 'OK '
|
|
97
105
|
headers:
|
|
98
106
|
x-ratelimit-limit:
|
|
99
|
-
- '
|
|
107
|
+
- '2000'
|
|
100
108
|
x-ratelimit-remaining:
|
|
101
|
-
- '
|
|
109
|
+
- '1835'
|
|
102
110
|
content-type:
|
|
103
111
|
- application/json; charset=utf-8
|
|
104
112
|
x-ua-compatible:
|
|
105
113
|
- IE=Edge
|
|
106
114
|
etag:
|
|
107
|
-
- ! '"
|
|
115
|
+
- ! '"96120f681b3f4d674e9ed3d4d2415326"'
|
|
108
116
|
cache-control:
|
|
109
117
|
- max-age=0, private, must-revalidate
|
|
110
|
-
set-cookie:
|
|
111
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTczYzIzZTVlNDBkNWViZGZjZDk4ZWZmODU0NTg2ZjViBjsAVA%3D%3D--506c6a7a832476913fc650fc50c471056c076de1;
|
|
112
|
-
path=/; HttpOnly
|
|
113
118
|
x-request-id:
|
|
114
|
-
-
|
|
119
|
+
- 6f6a25cf6aa5410df32ebd8a43226d5e
|
|
115
120
|
x-runtime:
|
|
116
|
-
- '2.
|
|
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'
|
|
117
128
|
connection:
|
|
118
129
|
- close
|
|
119
|
-
|
|
120
|
-
-
|
|
130
|
+
set-cookie:
|
|
131
|
+
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTA3N2NkMjRiYzdiMGNhNGEzZDY4NTgyNjMxZmMyY2Y1BjsAVA%3D%3D--06e5b338d9e80848dc18a9eb4ac0e2e83a453ceb;
|
|
132
|
+
path=/; HttpOnly
|
|
121
133
|
body:
|
|
122
134
|
encoding: US-ASCII
|
|
123
|
-
string: ! '{"id":
|
|
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"}'
|
|
124
136
|
http_version: '1.1'
|
|
125
|
-
recorded_at:
|
|
137
|
+
recorded_at: Tue, 04 Feb 2014 14:53:39 GMT
|
|
126
138
|
- request:
|
|
127
139
|
method: delete
|
|
128
|
-
uri: http://
|
|
140
|
+
uri: http://1spyno1mbqbp3SFpg9uT@localhost:3000/recrea/api/v1/webhooks/7.json
|
|
129
141
|
body:
|
|
130
142
|
encoding: US-ASCII
|
|
131
143
|
string: ''
|
|
132
144
|
headers:
|
|
133
145
|
authorization:
|
|
134
|
-
- Basic
|
|
146
|
+
- Basic MXNweW5vMW1icWJwM1NGcGc5dVQ6
|
|
135
147
|
response:
|
|
136
148
|
status:
|
|
137
149
|
code: 204
|
|
138
|
-
message: No Content
|
|
150
|
+
message: ! 'No Content '
|
|
139
151
|
headers:
|
|
140
152
|
x-ratelimit-limit:
|
|
141
|
-
- '
|
|
153
|
+
- '2000'
|
|
142
154
|
x-ratelimit-remaining:
|
|
143
|
-
- '
|
|
155
|
+
- '1834'
|
|
144
156
|
x-ua-compatible:
|
|
145
157
|
- IE=Edge
|
|
146
158
|
cache-control:
|
|
147
159
|
- no-cache
|
|
148
|
-
set-cookie:
|
|
149
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTRkNDZlZjVhMDUyNzU2OGMwYWU3MjE1MmFlZDhkZjY4BjsAVA%3D%3D--4bf40e81e810643c750f521be437f3a3487741d6;
|
|
150
|
-
path=/; HttpOnly
|
|
151
160
|
x-request-id:
|
|
152
|
-
-
|
|
161
|
+
- 3620607b91bbc7d67072e8c97f8a7de8
|
|
153
162
|
x-runtime:
|
|
154
|
-
- '0.
|
|
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
|
|
155
168
|
connection:
|
|
156
169
|
- close
|
|
157
|
-
|
|
158
|
-
-
|
|
170
|
+
set-cookie:
|
|
171
|
+
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTA4MDZmOTYwMjhmMTMzZTI2ZWY3NGY0YjhiM2FhYWZmBjsAVA%3D%3D--0738ff8612e7e7ee369998c721b71a4fd37a9f3c;
|
|
172
|
+
path=/; HttpOnly
|
|
159
173
|
body:
|
|
160
174
|
encoding: US-ASCII
|
|
161
175
|
string: ''
|
|
162
176
|
http_version: '1.1'
|
|
163
|
-
recorded_at:
|
|
177
|
+
recorded_at: Tue, 04 Feb 2014 14:53:40 GMT
|
|
164
178
|
recorded_with: VCR 2.3.0
|
data/test/helper.rb
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
3
|
+
|
|
1
4
|
require 'rubygems'
|
|
2
5
|
require 'bundler'
|
|
3
|
-
require 'ruby-debug'
|
|
4
|
-
require 'vcr'
|
|
5
|
-
|
|
6
|
-
VCR.configure do |c|
|
|
7
|
-
c.cassette_library_dir = 'test/fixtures/quaderno_cassettes'
|
|
8
|
-
c.ignore_localhost = false
|
|
9
|
-
c.hook_into :fakeweb
|
|
10
|
-
end
|
|
11
6
|
|
|
12
7
|
begin
|
|
13
|
-
Bundler.setup(:default, :
|
|
8
|
+
Bundler.setup(:default, :test)
|
|
14
9
|
rescue Bundler::BundlerError => e
|
|
15
10
|
$stderr.puts e.message
|
|
16
11
|
$stderr.puts "Run `bundle install` to install missing gems"
|
|
17
12
|
exit e.status_code
|
|
18
13
|
end
|
|
14
|
+
|
|
15
|
+
require 'vcr'
|
|
19
16
|
require 'test/unit'
|
|
20
17
|
require 'shoulda'
|
|
21
|
-
|
|
22
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
23
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
24
18
|
require 'quaderno-ruby'
|
|
25
19
|
|
|
20
|
+
VCR.configure do |c|
|
|
21
|
+
c.cassette_library_dir = 'test/fixtures/quaderno_cassettes'
|
|
22
|
+
c.ignore_localhost = false
|
|
23
|
+
c.hook_into :fakeweb
|
|
24
|
+
end
|
|
25
|
+
|
|
26
26
|
class Test::Unit::TestCase
|
|
27
27
|
end
|
|
@@ -5,8 +5,9 @@ class TestQuadernoContact < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -79,8 +80,8 @@ class TestQuadernoContact < Test::Unit::TestCase
|
|
|
79
80
|
should "know the rate limit" do
|
|
80
81
|
VCR.use_cassette('rate limit') do
|
|
81
82
|
rate_limit_info = Quaderno::Base.rate_limit_info
|
|
82
|
-
assert_equal
|
|
83
|
-
assert_operator rate_limit_info[:remaining], :< ,
|
|
83
|
+
assert_equal 2000, rate_limit_info[:limit]
|
|
84
|
+
assert_operator rate_limit_info[:remaining], :< ,2000
|
|
84
85
|
end
|
|
85
86
|
end
|
|
86
87
|
end
|
|
@@ -5,8 +5,9 @@ class TestQuadernoEstimate < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -5,8 +5,9 @@ class TestQuadernoExpense < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -115,7 +116,7 @@ class TestQuadernoExpense < Test::Unit::TestCase
|
|
|
115
116
|
payment = expenses.first.add_payment(payment_method: "cash", amount: "10000")
|
|
116
117
|
assert_kind_of Quaderno::Payment, payment
|
|
117
118
|
assert_equal "cash", payment.payment_method
|
|
118
|
-
assert_equal "10,000.00", payment.amount[
|
|
119
|
+
assert_equal "10,000.00", payment.amount[0..payment.amount.length - 3]
|
|
119
120
|
assert_equal expenses.first.payments.last.id, payment.id
|
|
120
121
|
end
|
|
121
122
|
end
|
|
@@ -5,8 +5,9 @@ class TestQuadernoInvoice < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -130,7 +131,7 @@ class TestQuadernoInvoice < Test::Unit::TestCase
|
|
|
130
131
|
payment = invoices.first.add_payment(payment_method: "cash", amount: "100000000")
|
|
131
132
|
assert_kind_of Quaderno::Payment, payment
|
|
132
133
|
assert_equal "cash", payment.payment_method
|
|
133
|
-
assert_equal "100,000,000.00", payment.amount[
|
|
134
|
+
assert_equal "100,000,000.00", payment.amount[0..payment.amount.length - 3]
|
|
134
135
|
assert_equal invoices.first.payments.last.id, payment.id
|
|
135
136
|
end
|
|
136
137
|
end
|
|
@@ -5,8 +5,9 @@ class TestQuadernoItem < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -74,8 +75,8 @@ class TestQuadernoItem < Test::Unit::TestCase
|
|
|
74
75
|
should "know the rate limit" do
|
|
75
76
|
VCR.use_cassette('rate limit') do
|
|
76
77
|
rate_limit_info = Quaderno::Base.rate_limit_info
|
|
77
|
-
assert_equal
|
|
78
|
-
assert_operator rate_limit_info[:remaining], :< ,
|
|
78
|
+
assert_equal 2000, rate_limit_info[:limit]
|
|
79
|
+
assert_operator rate_limit_info[:remaining], :< ,2000
|
|
79
80
|
end
|
|
80
81
|
end
|
|
81
82
|
end
|
|
@@ -5,8 +5,9 @@ class TestQuadernoWebhook < Test::Unit::TestCase
|
|
|
5
5
|
|
|
6
6
|
setup do
|
|
7
7
|
Quaderno::Base.configure do |config|
|
|
8
|
-
config.auth_token = '
|
|
8
|
+
config.auth_token = '1spyno1mbqbp3SFpg9uT'
|
|
9
9
|
config.subdomain = 'recrea'
|
|
10
|
+
config.debug = true
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
@@ -85,8 +86,8 @@ class TestQuadernoWebhook < Test::Unit::TestCase
|
|
|
85
86
|
should "know the rate limit" do
|
|
86
87
|
VCR.use_cassette('rate limit') do
|
|
87
88
|
rate_limit_info = Quaderno::Base.rate_limit_info
|
|
88
|
-
assert_equal
|
|
89
|
-
assert_operator rate_limit_info[:remaining], :< ,
|
|
89
|
+
assert_equal 2000, rate_limit_info[:limit]
|
|
90
|
+
assert_operator rate_limit_info[:remaining], :< ,2000
|
|
90
91
|
end
|
|
91
92
|
end
|
|
92
93
|
end
|