ynab 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/Rakefile +9 -0
- data/config.json +2 -2
- data/docs/Account.md +1 -1
- data/docs/AccountResponse.md +1 -1
- data/docs/AccountWrapper.md +1 -1
- data/docs/AccountsApi.md +1 -1
- data/docs/AccountsResponse.md +1 -1
- data/docs/AccountsWrapper.md +1 -1
- data/docs/BudgetDetail.md +1 -1
- data/docs/BudgetDetailResponse.md +1 -1
- data/docs/BudgetDetailWrapper.md +1 -1
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +1 -1
- data/docs/BudgetSummaryResponse.md +1 -1
- data/docs/BudgetSummaryWrapper.md +1 -1
- data/docs/BudgetsApi.md +19 -1
- data/docs/BulkIdWrapper.md +1 -1
- data/docs/BulkIds.md +1 -1
- data/docs/BulkResponse.md +1 -1
- data/docs/BulkTransactionCreateResponse.md +2 -2
- data/docs/BulkTransactionIds.md +2 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +1 -1
- data/docs/CategoriesResponse.md +1 -1
- data/docs/Category.md +2 -1
- data/docs/CategoryGroup.md +1 -1
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/CategoryGroupsWrapper.md +1 -1
- data/docs/CategoryResponse.md +1 -1
- data/docs/CategoryWrapper.md +1 -1
- data/docs/CurrencyFormat.md +1 -1
- data/docs/DateFormat.md +1 -1
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorResponse.md +1 -1
- data/docs/HybridTransaction.md +1 -1
- data/docs/HybridTransactionsResponse.md +1 -1
- data/docs/HybridTransactionsWrapper.md +1 -1
- data/docs/MonthDetail.md +1 -1
- data/docs/MonthDetailResponse.md +1 -1
- data/docs/MonthDetailWrapper.md +1 -1
- data/docs/MonthSummariesResponse.md +1 -1
- data/docs/MonthSummariesWrapper.md +1 -1
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +1 -1
- data/docs/Payee.md +1 -1
- data/docs/PayeeLocation.md +1 -1
- data/docs/PayeeLocationResponse.md +1 -1
- data/docs/PayeeLocationWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +1 -1
- data/docs/PayeeLocationsResponse.md +1 -1
- data/docs/PayeeLocationsWrapper.md +1 -1
- data/docs/PayeeResponse.md +1 -1
- data/docs/PayeeWrapper.md +1 -1
- data/docs/PayeesApi.md +1 -1
- data/docs/PayeesResponse.md +1 -1
- data/docs/PayeesWrapper.md +1 -1
- data/docs/SaveTransaction.md +2 -2
- data/docs/SaveTransactionWrapper.md +1 -1
- data/docs/ScheduledSubTransaction.md +1 -1
- data/docs/ScheduledTransactionDetail.md +1 -1
- data/docs/ScheduledTransactionResponse.md +1 -1
- data/docs/ScheduledTransactionSummary.md +1 -1
- data/docs/ScheduledTransactionWrapper.md +1 -1
- data/docs/ScheduledTransactionsApi.md +1 -1
- data/docs/ScheduledTransactionsResponse.md +1 -1
- data/docs/ScheduledTransactionsWrapper.md +1 -1
- data/docs/SubTransaction.md +1 -1
- data/docs/TransactionDetail.md +1 -1
- data/docs/TransactionResponse.md +1 -1
- data/docs/TransactionSummary.md +1 -1
- data/docs/TransactionWrapper.md +1 -1
- data/docs/TransactionsApi.md +5 -2
- data/docs/TransactionsResponse.md +1 -1
- data/docs/TransactionsWrapper.md +1 -1
- data/docs/User.md +1 -1
- data/docs/UserApi.md +1 -1
- data/docs/UserResponse.md +1 -1
- data/docs/UserWrapper.md +1 -1
- data/examples/budget-list.rb +1 -1
- data/examples/budget-month.rb +1 -1
- data/examples/category-balance.rb +1 -1
- data/lib/ynab.rb +27 -15
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/budgets_api.rb +53 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/months_api.rb +1 -1
- data/lib/ynab/api/payee_locations_api.rb +1 -1
- data/lib/ynab/api/payees_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +21 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/api_error.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +2 -2
- data/lib/ynab/models/account_response.rb +2 -2
- data/lib/ynab/models/account_wrapper.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +2 -2
- data/lib/ynab/models/accounts_wrapper.rb +2 -2
- data/lib/ynab/models/budget_detail.rb +2 -2
- data/lib/ynab/models/budget_detail_response.rb +2 -2
- data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
- data/lib/ynab/models/budget_settings.rb +202 -0
- data/lib/ynab/models/budget_settings_response.rb +188 -0
- data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
- data/lib/ynab/models/budget_summary.rb +2 -2
- data/lib/ynab/models/budget_summary_response.rb +2 -2
- data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_ids.rb +2 -2
- data/lib/ynab/models/bulk_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
- data/lib/ynab/models/bulk_transactions.rb +2 -2
- data/lib/ynab/models/categories_response.rb +2 -2
- data/lib/ynab/models/category.rb +13 -3
- data/lib/ynab/models/category_group.rb +2 -2
- data/lib/ynab/models/category_group_with_categories.rb +2 -2
- data/lib/ynab/models/category_groups_wrapper.rb +2 -2
- data/lib/ynab/models/category_response.rb +2 -2
- data/lib/ynab/models/category_wrapper.rb +2 -2
- data/lib/ynab/models/currency_format.rb +2 -2
- data/lib/ynab/models/date_format.rb +2 -2
- data/lib/ynab/models/error_detail.rb +2 -2
- data/lib/ynab/models/error_response.rb +2 -2
- data/lib/ynab/models/hybrid_transaction.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/month_detail.rb +2 -2
- data/lib/ynab/models/month_detail_response.rb +2 -2
- data/lib/ynab/models/month_detail_wrapper.rb +2 -2
- data/lib/ynab/models/month_summaries_response.rb +2 -2
- data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
- data/lib/ynab/models/month_summary.rb +2 -2
- data/lib/ynab/models/payee.rb +2 -2
- data/lib/ynab/models/payee_location.rb +2 -2
- data/lib/ynab/models/payee_location_response.rb +2 -2
- data/lib/ynab/models/payee_location_wrapper.rb +2 -2
- data/lib/ynab/models/payee_locations_response.rb +2 -2
- data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
- data/lib/ynab/models/payee_response.rb +2 -2
- data/lib/ynab/models/payee_wrapper.rb +2 -2
- data/lib/ynab/models/payees_response.rb +2 -2
- data/lib/ynab/models/payees_wrapper.rb +2 -2
- data/lib/ynab/models/save_transaction.rb +3 -3
- data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/sub_transaction.rb +2 -2
- data/lib/ynab/models/transaction_detail.rb +2 -2
- data/lib/ynab/models/transaction_response.rb +2 -2
- data/lib/ynab/models/transaction_summary.rb +2 -2
- data/lib/ynab/models/transaction_wrapper.rb +2 -2
- data/lib/ynab/models/transactions_response.rb +2 -2
- data/lib/ynab/models/transactions_wrapper.rb +2 -2
- data/lib/ynab/models/user.rb +2 -2
- data/lib/ynab/models/user_response.rb +2 -2
- data/lib/ynab/models/user_wrapper.rb +2 -2
- data/lib/ynab/version.rb +2 -2
- data/pkg/ynab-1.0.0.gem +0 -0
- data/pkg/ynab-1.1.0.gem +0 -0
- data/spec-v1-swagger.json +105 -3
- data/spec/api/accounts_spec.rb +13 -4
- data/spec/api/budgets_spec.rb +4 -4
- data/spec/api/categories_spec.rb +4 -4
- data/spec/api/months_spec.rb +4 -4
- data/spec/api/payee_locations_spec.rb +4 -4
- data/spec/api/payees_spec.rb +4 -4
- data/spec/api/scheduled_transactions_spec.rb +4 -4
- data/spec/api/transactions_spec.rb +4 -4
- data/swagger-templates/gem.mustache +83 -0
- data/ynab.gemspec +1 -1
- metadata +11 -2
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
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 =
|
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
|
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 =
|
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
|
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 =
|
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
|
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 =
|
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
|
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 =
|
143
|
+
temp_model = YNAB.const_get(type).new
|
144
144
|
temp_model.build_from_hash(value)
|
145
145
|
end
|
146
146
|
end
|
data/lib/ynab/models/user.rb
CHANGED
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
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 =
|
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
|
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 =
|
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
|
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 =
|
141
|
+
temp_model = YNAB.const_get(type).new
|
142
142
|
temp_model.build_from_hash(value)
|
143
143
|
end
|
144
144
|
end
|
data/lib/ynab/version.rb
CHANGED
data/pkg/ynab-1.0.0.gem
ADDED
Binary file
|
data/pkg/ynab-1.1.0.gem
ADDED
Binary file
|
data/spec-v1-swagger.json
CHANGED
@@ -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 (
|
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
|
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
|
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",
|
data/spec/api/accounts_spec.rb
CHANGED
@@ -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) {
|
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(
|
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 =
|
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
|
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
|
data/spec/api/budgets_spec.rb
CHANGED
@@ -2,12 +2,12 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'budgets' do
|
4
4
|
let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
|
5
|
-
let(:client) {
|
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(
|
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 =
|
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
|
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
|
data/spec/api/categories_spec.rb
CHANGED
@@ -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) {
|
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(
|
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 =
|
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
|
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
|
data/spec/api/months_spec.rb
CHANGED
@@ -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) {
|
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(
|
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 =
|
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
|
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
|