ynab 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +2 -2
  4. data/Rakefile +9 -0
  5. data/config.json +2 -2
  6. data/docs/Account.md +1 -1
  7. data/docs/AccountResponse.md +1 -1
  8. data/docs/AccountWrapper.md +1 -1
  9. data/docs/AccountsApi.md +1 -1
  10. data/docs/AccountsResponse.md +1 -1
  11. data/docs/AccountsWrapper.md +1 -1
  12. data/docs/BudgetDetail.md +1 -1
  13. data/docs/BudgetDetailResponse.md +1 -1
  14. data/docs/BudgetDetailWrapper.md +1 -1
  15. data/docs/BudgetSettings.md +9 -0
  16. data/docs/BudgetSettingsResponse.md +8 -0
  17. data/docs/BudgetSettingsWrapper.md +8 -0
  18. data/docs/BudgetSummary.md +1 -1
  19. data/docs/BudgetSummaryResponse.md +1 -1
  20. data/docs/BudgetSummaryWrapper.md +1 -1
  21. data/docs/BudgetsApi.md +19 -1
  22. data/docs/BulkIdWrapper.md +1 -1
  23. data/docs/BulkIds.md +1 -1
  24. data/docs/BulkResponse.md +1 -1
  25. data/docs/BulkTransactionCreateResponse.md +2 -2
  26. data/docs/BulkTransactionIds.md +2 -2
  27. data/docs/BulkTransactions.md +1 -1
  28. data/docs/CategoriesApi.md +1 -1
  29. data/docs/CategoriesResponse.md +1 -1
  30. data/docs/Category.md +2 -1
  31. data/docs/CategoryGroup.md +1 -1
  32. data/docs/CategoryGroupWithCategories.md +1 -1
  33. data/docs/CategoryGroupsWrapper.md +1 -1
  34. data/docs/CategoryResponse.md +1 -1
  35. data/docs/CategoryWrapper.md +1 -1
  36. data/docs/CurrencyFormat.md +1 -1
  37. data/docs/DateFormat.md +1 -1
  38. data/docs/ErrorDetail.md +1 -1
  39. data/docs/ErrorResponse.md +1 -1
  40. data/docs/HybridTransaction.md +1 -1
  41. data/docs/HybridTransactionsResponse.md +1 -1
  42. data/docs/HybridTransactionsWrapper.md +1 -1
  43. data/docs/MonthDetail.md +1 -1
  44. data/docs/MonthDetailResponse.md +1 -1
  45. data/docs/MonthDetailWrapper.md +1 -1
  46. data/docs/MonthSummariesResponse.md +1 -1
  47. data/docs/MonthSummariesWrapper.md +1 -1
  48. data/docs/MonthSummary.md +1 -1
  49. data/docs/MonthsApi.md +1 -1
  50. data/docs/Payee.md +1 -1
  51. data/docs/PayeeLocation.md +1 -1
  52. data/docs/PayeeLocationResponse.md +1 -1
  53. data/docs/PayeeLocationWrapper.md +1 -1
  54. data/docs/PayeeLocationsApi.md +1 -1
  55. data/docs/PayeeLocationsResponse.md +1 -1
  56. data/docs/PayeeLocationsWrapper.md +1 -1
  57. data/docs/PayeeResponse.md +1 -1
  58. data/docs/PayeeWrapper.md +1 -1
  59. data/docs/PayeesApi.md +1 -1
  60. data/docs/PayeesResponse.md +1 -1
  61. data/docs/PayeesWrapper.md +1 -1
  62. data/docs/SaveTransaction.md +2 -2
  63. data/docs/SaveTransactionWrapper.md +1 -1
  64. data/docs/ScheduledSubTransaction.md +1 -1
  65. data/docs/ScheduledTransactionDetail.md +1 -1
  66. data/docs/ScheduledTransactionResponse.md +1 -1
  67. data/docs/ScheduledTransactionSummary.md +1 -1
  68. data/docs/ScheduledTransactionWrapper.md +1 -1
  69. data/docs/ScheduledTransactionsApi.md +1 -1
  70. data/docs/ScheduledTransactionsResponse.md +1 -1
  71. data/docs/ScheduledTransactionsWrapper.md +1 -1
  72. data/docs/SubTransaction.md +1 -1
  73. data/docs/TransactionDetail.md +1 -1
  74. data/docs/TransactionResponse.md +1 -1
  75. data/docs/TransactionSummary.md +1 -1
  76. data/docs/TransactionWrapper.md +1 -1
  77. data/docs/TransactionsApi.md +5 -2
  78. data/docs/TransactionsResponse.md +1 -1
  79. data/docs/TransactionsWrapper.md +1 -1
  80. data/docs/User.md +1 -1
  81. data/docs/UserApi.md +1 -1
  82. data/docs/UserResponse.md +1 -1
  83. data/docs/UserWrapper.md +1 -1
  84. data/examples/budget-list.rb +1 -1
  85. data/examples/budget-month.rb +1 -1
  86. data/examples/category-balance.rb +1 -1
  87. data/lib/ynab.rb +27 -15
  88. data/lib/ynab/api/accounts_api.rb +1 -1
  89. data/lib/ynab/api/budgets_api.rb +53 -1
  90. data/lib/ynab/api/categories_api.rb +1 -1
  91. data/lib/ynab/api/months_api.rb +1 -1
  92. data/lib/ynab/api/payee_locations_api.rb +1 -1
  93. data/lib/ynab/api/payees_api.rb +1 -1
  94. data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
  95. data/lib/ynab/api/transactions_api.rb +21 -3
  96. data/lib/ynab/api/user_api.rb +1 -1
  97. data/lib/ynab/api_client.rb +2 -2
  98. data/lib/ynab/api_error.rb +1 -1
  99. data/lib/ynab/configuration.rb +1 -1
  100. data/lib/ynab/models/account.rb +2 -2
  101. data/lib/ynab/models/account_response.rb +2 -2
  102. data/lib/ynab/models/account_wrapper.rb +2 -2
  103. data/lib/ynab/models/accounts_response.rb +2 -2
  104. data/lib/ynab/models/accounts_wrapper.rb +2 -2
  105. data/lib/ynab/models/budget_detail.rb +2 -2
  106. data/lib/ynab/models/budget_detail_response.rb +2 -2
  107. data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
  108. data/lib/ynab/models/budget_settings.rb +202 -0
  109. data/lib/ynab/models/budget_settings_response.rb +188 -0
  110. data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
  111. data/lib/ynab/models/budget_summary.rb +2 -2
  112. data/lib/ynab/models/budget_summary_response.rb +2 -2
  113. data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
  114. data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
  115. data/lib/ynab/models/bulk_ids.rb +2 -2
  116. data/lib/ynab/models/bulk_response.rb +2 -2
  117. data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
  118. data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
  119. data/lib/ynab/models/bulk_transactions.rb +2 -2
  120. data/lib/ynab/models/categories_response.rb +2 -2
  121. data/lib/ynab/models/category.rb +13 -3
  122. data/lib/ynab/models/category_group.rb +2 -2
  123. data/lib/ynab/models/category_group_with_categories.rb +2 -2
  124. data/lib/ynab/models/category_groups_wrapper.rb +2 -2
  125. data/lib/ynab/models/category_response.rb +2 -2
  126. data/lib/ynab/models/category_wrapper.rb +2 -2
  127. data/lib/ynab/models/currency_format.rb +2 -2
  128. data/lib/ynab/models/date_format.rb +2 -2
  129. data/lib/ynab/models/error_detail.rb +2 -2
  130. data/lib/ynab/models/error_response.rb +2 -2
  131. data/lib/ynab/models/hybrid_transaction.rb +2 -2
  132. data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
  133. data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
  134. data/lib/ynab/models/month_detail.rb +2 -2
  135. data/lib/ynab/models/month_detail_response.rb +2 -2
  136. data/lib/ynab/models/month_detail_wrapper.rb +2 -2
  137. data/lib/ynab/models/month_summaries_response.rb +2 -2
  138. data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
  139. data/lib/ynab/models/month_summary.rb +2 -2
  140. data/lib/ynab/models/payee.rb +2 -2
  141. data/lib/ynab/models/payee_location.rb +2 -2
  142. data/lib/ynab/models/payee_location_response.rb +2 -2
  143. data/lib/ynab/models/payee_location_wrapper.rb +2 -2
  144. data/lib/ynab/models/payee_locations_response.rb +2 -2
  145. data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
  146. data/lib/ynab/models/payee_response.rb +2 -2
  147. data/lib/ynab/models/payee_wrapper.rb +2 -2
  148. data/lib/ynab/models/payees_response.rb +2 -2
  149. data/lib/ynab/models/payees_wrapper.rb +2 -2
  150. data/lib/ynab/models/save_transaction.rb +3 -3
  151. data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
  152. data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
  153. data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
  154. data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
  155. data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
  156. data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
  157. data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
  158. data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
  159. data/lib/ynab/models/sub_transaction.rb +2 -2
  160. data/lib/ynab/models/transaction_detail.rb +2 -2
  161. data/lib/ynab/models/transaction_response.rb +2 -2
  162. data/lib/ynab/models/transaction_summary.rb +2 -2
  163. data/lib/ynab/models/transaction_wrapper.rb +2 -2
  164. data/lib/ynab/models/transactions_response.rb +2 -2
  165. data/lib/ynab/models/transactions_wrapper.rb +2 -2
  166. data/lib/ynab/models/user.rb +2 -2
  167. data/lib/ynab/models/user_response.rb +2 -2
  168. data/lib/ynab/models/user_wrapper.rb +2 -2
  169. data/lib/ynab/version.rb +2 -2
  170. data/pkg/ynab-1.0.0.gem +0 -0
  171. data/pkg/ynab-1.1.0.gem +0 -0
  172. data/spec-v1-swagger.json +105 -3
  173. data/spec/api/accounts_spec.rb +13 -4
  174. data/spec/api/budgets_spec.rb +4 -4
  175. data/spec/api/categories_spec.rb +4 -4
  176. data/spec/api/months_spec.rb +4 -4
  177. data/spec/api/payee_locations_spec.rb +4 -4
  178. data/spec/api/payees_spec.rb +4 -4
  179. data/spec/api/scheduled_transactions_spec.rb +4 -4
  180. data/spec/api/transactions_spec.rb +4 -4
  181. data/swagger-templates/gem.mustache +83 -0
  182. data/ynab.gemspec +1 -1
  183. metadata +11 -2
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class TransactionResponse
17
17
  attr_accessor :data
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class TransactionSummary
17
17
  attr_accessor :id
18
18
 
@@ -358,7 +358,7 @@ module YnabApi
358
358
  end
359
359
  end
360
360
  else # model
361
- temp_model = YnabApi.const_get(type).new
361
+ temp_model = YNAB.const_get(type).new
362
362
  temp_model.build_from_hash(value)
363
363
  end
364
364
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class TransactionWrapper
17
17
  attr_accessor :transaction
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class TransactionsResponse
17
17
  attr_accessor :data
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class TransactionsWrapper
17
17
  attr_accessor :transactions
18
18
 
@@ -140,7 +140,7 @@ module YnabApi
140
140
  end
141
141
  end
142
142
  else # model
143
- temp_model = YnabApi.const_get(type).new
143
+ temp_model = YNAB.const_get(type).new
144
144
  temp_model.build_from_hash(value)
145
145
  end
146
146
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class User
17
17
  attr_accessor :id
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class UserResponse
17
17
  attr_accessor :data
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class UserWrapper
17
17
  attr_accessor :user
18
18
 
@@ -138,7 +138,7 @@ module YnabApi
138
138
  end
139
139
  end
140
140
  else # model
141
- temp_model = YnabApi.const_get(type).new
141
+ temp_model = YNAB.const_get(type).new
142
142
  temp_model.build_from_hash(value)
143
143
  end
144
144
  end
@@ -10,6 +10,6 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
- module YnabApi
14
- VERSION = '1.0.0'
13
+ module YNAB
14
+ VERSION = '1.1.0'
15
15
  end
Binary file
Binary file
@@ -154,6 +154,46 @@
154
154
  }
155
155
  }
156
156
  },
157
+ "/budgets/{budget_id}/settings": {
158
+ "get": {
159
+ "tags": ["Budgets"],
160
+ "summary": "Budget Settings",
161
+ "description":
162
+ "Returns settings for a budget.",
163
+ "operationId": "getBudgetSettingsById",
164
+ "produces": ["application/json"],
165
+ "parameters": [
166
+ {
167
+ "name": "budget_id",
168
+ "in": "path",
169
+ "description": "The ID of the Budget.",
170
+ "required": true,
171
+ "type": "string",
172
+ "format": "uuid"
173
+ }
174
+ ],
175
+ "responses": {
176
+ "200": {
177
+ "description": "The requested Budget Settings.",
178
+ "schema": {
179
+ "$ref": "#/definitions/BudgetSettingsResponse"
180
+ }
181
+ },
182
+ "404": {
183
+ "description": "The specified Budget was not found.",
184
+ "schema": {
185
+ "$ref": "#/definitions/ErrorResponse"
186
+ }
187
+ },
188
+ "default": {
189
+ "description": "An error occurred.",
190
+ "schema": {
191
+ "$ref": "#/definitions/ErrorResponse"
192
+ }
193
+ }
194
+ }
195
+ }
196
+ },
157
197
  "/budgets/{budget_id}/accounts": {
158
198
  "get": {
159
199
  "tags": ["Accounts"],
@@ -660,7 +700,7 @@
660
700
  "name": "type",
661
701
  "in": "query",
662
702
  "description":
663
- "Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')",
703
+ "Only return transactions of a certain type ('uncategorized' and 'unapproved' are currently supported)",
664
704
  "required": false,
665
705
  "type": "string",
666
706
  "enum": ["uncategorized", "unapproved"]
@@ -801,6 +841,15 @@
801
841
  "required": false,
802
842
  "type": "string",
803
843
  "format": "date"
844
+ },
845
+ {
846
+ "name": "type",
847
+ "in": "query",
848
+ "description":
849
+ "Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')",
850
+ "required": false,
851
+ "type": "string",
852
+ "enum": ["uncategorized", "unapproved"]
804
853
  }
805
854
  ],
806
855
  "responses": {
@@ -856,6 +905,15 @@
856
905
  "required": false,
857
906
  "type": "string",
858
907
  "format": "date"
908
+ },
909
+ {
910
+ "name": "type",
911
+ "in": "query",
912
+ "description":
913
+ "Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')",
914
+ "required": false,
915
+ "type": "string",
916
+ "enum": ["uncategorized", "unapproved"]
859
917
  }
860
918
  ],
861
919
  "responses": {
@@ -911,6 +969,15 @@
911
969
  "required": false,
912
970
  "type": "string",
913
971
  "format": "date"
972
+ },
973
+ {
974
+ "name": "type",
975
+ "in": "query",
976
+ "description":
977
+ "Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')",
978
+ "required": false,
979
+ "type": "string",
980
+ "enum": ["uncategorized", "unapproved"]
914
981
  }
915
982
  ],
916
983
  "responses": {
@@ -1016,7 +1083,7 @@
1016
1083
  ],
1017
1084
  "responses": {
1018
1085
  "200": {
1019
- "description": "The Transaction was successfull updated.",
1086
+ "description": "The Transaction was successfully updated.",
1020
1087
  "schema": {
1021
1088
  "$ref": "#/definitions/TransactionResponse"
1022
1089
  }
@@ -1268,6 +1335,24 @@
1268
1335
  }
1269
1336
  }
1270
1337
  },
1338
+ "BudgetSettingsResponse": {
1339
+ "type": "object",
1340
+ "required": ["data"],
1341
+ "properties": {
1342
+ "data": {
1343
+ "$ref": "#/definitions/BudgetSettingsWrapper"
1344
+ }
1345
+ }
1346
+ },
1347
+ "BudgetSettingsWrapper": {
1348
+ "type": "object",
1349
+ "required": ["settings"],
1350
+ "properties": {
1351
+ "settings": {
1352
+ "$ref": "#/definitions/BudgetSettings"
1353
+ }
1354
+ }
1355
+ },
1271
1356
  "BudgetSummary": {
1272
1357
  "type": "object",
1273
1358
  "required": ["id", "name"],
@@ -1293,6 +1378,18 @@
1293
1378
  }
1294
1379
  }
1295
1380
  },
1381
+ "BudgetSettings": {
1382
+ "type": "object",
1383
+ "required": ["date_format", "currency_format"],
1384
+ "properties": {
1385
+ "date_format": {
1386
+ "$ref": "#/definitions/DateFormat"
1387
+ },
1388
+ "currency_format": {
1389
+ "$ref": "#/definitions/CurrencyFormat"
1390
+ }
1391
+ }
1392
+ },
1296
1393
  "BudgetDetail": {
1297
1394
  "allOf": [
1298
1395
  {
@@ -1587,6 +1684,11 @@
1587
1684
  "description": "Whether or not the category is hidden",
1588
1685
  "type": "boolean"
1589
1686
  },
1687
+ "original_category_group_id": {
1688
+ "description": "If category is hidden this is the id of the category group it originally belonged to before it was hidden.",
1689
+ "type": "string",
1690
+ "format": "uuid"
1691
+ },
1590
1692
  "note": {
1591
1693
  "type": "string"
1592
1694
  },
@@ -1976,7 +2078,7 @@
1976
2078
  "payee_name": {
1977
2079
  "type": "string",
1978
2080
  "description":
1979
- "The payee name. If a payee_name value is provided and payee_id is not included or has a null value, payee_name will be used to create or use an existing payee."
2081
+ "The payee name. If a payee_name value is provided and payee_id has a null value, the payee_name value will be used to resolve the payee by either (1) a matching payee rename rule (only if import_id is also specified) or (2) a payee with the same name or (3) creation of a new payee."
1980
2082
  },
1981
2083
  "category_id": {
1982
2084
  "type": "string",
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'accounts' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.accounts }
8
8
 
9
9
  describe 'test an instance of AccountsApi' do
10
10
  it 'should create an instance of AccountsApi' do
11
- expect(instance).to be_instance_of(YnabApi::AccountsApi)
11
+ expect(instance).to be_instance_of(YNAB::AccountsApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'accounts' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("accounts_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.accounts.get_accounts(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end
@@ -53,4 +53,13 @@ describe 'accounts' do
53
53
  end
54
54
  end
55
55
  end
56
+
57
+ it "foobar" do
58
+ VCR.use_cassette("accounts") do
59
+ client = YnabApi::Client.new(access_token, 'api.localhost:3000', false)
60
+ response = client.accounts.get_accounts(budget_id)
61
+ expect(client.last_request.response.options[:code]).to be 200
62
+ expect(response.data.accounts.length).to be 1
63
+ end
64
+ end
56
65
  end
@@ -2,12 +2,12 @@ require 'spec_helper'
2
2
 
3
3
  describe 'budgets' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
5
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
6
6
  let (:instance) { client.budgets }
7
7
 
8
8
  describe 'test an instance of BudgetsApi' do
9
9
  it 'should create an instance of BudgetsApi' do
10
- expect(instance).to be_instance_of(YnabApi::BudgetsApi)
10
+ expect(instance).to be_instance_of(YNAB::BudgetsApi)
11
11
  end
12
12
  end
13
13
 
@@ -22,10 +22,10 @@ describe 'budgets' do
22
22
 
23
23
  it "throws when unauthorized" do
24
24
  VCR.use_cassette("budgets_unauthorized") do
25
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
25
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
26
26
  begin
27
27
  response = client.budgets.get_budgets
28
- rescue YnabApi::ApiError => e
28
+ rescue YNAB::ApiError => e
29
29
  expect(e.code).to be 401
30
30
  expect(client.last_request.response.options[:code]).to be 401
31
31
  end
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'categories' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.categories }
8
8
 
9
9
  describe 'test an instance of CategoriesApi' do
10
10
  it 'should create an instance of CategoriesApi' do
11
- expect(instance).to be_instance_of(YnabApi::CategoriesApi)
11
+ expect(instance).to be_instance_of(YNAB::CategoriesApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'categories' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("categories_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.categories.get_categories(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'months' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.months }
8
8
 
9
9
  describe 'test an instance of MonthsApi' do
10
10
  it 'should create an instance of MonthsApi' do
11
- expect(instance).to be_instance_of(YnabApi::MonthsApi)
11
+ expect(instance).to be_instance_of(YNAB::MonthsApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'months' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("months_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.months.get_budget_months(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end