ynab 1.19.0 → 1.20.0

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.
@@ -12,7 +12,7 @@ describe 'budgets' do
12
12
  end
13
13
 
14
14
  describe 'authorization' do
15
- it "sets the Bearer Auth header correctly" do
15
+ it 'sets the Bearer Auth header correctly' do
16
16
  VCR.use_cassette("budgets") do
17
17
  response = instance.get_budgets
18
18
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -20,7 +20,7 @@ describe 'budgets' do
20
20
  end
21
21
  end
22
22
 
23
- it "throws when unauthorized" do
23
+ it 'throws when unauthorized' do
24
24
  VCR.use_cassette("budgets_unauthorized") do
25
25
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
26
26
  begin
@@ -34,7 +34,7 @@ describe 'budgets' do
34
34
  end
35
35
 
36
36
  describe 'GET /budgets' do
37
- it "returns a list of budgets" do
37
+ it 'returns a list of budgets' do
38
38
  VCR.use_cassette("budgets") do
39
39
  response = instance.get_budgets
40
40
  expect(client.last_request.response.options[:code]).to be 200
@@ -44,7 +44,7 @@ describe 'budgets' do
44
44
  end
45
45
 
46
46
  describe 'GET /budgets/{budget_id}' do
47
- it "returns a budget" do
47
+ it 'returns a budget' do
48
48
  VCR.use_cassette("budget") do
49
49
  response = instance.get_budget_by_id('f419ac25-6217-4175-88dc-c3136ff5f6fd')
50
50
  expect(response.data.budget).to be
@@ -14,7 +14,7 @@ describe 'categories' do
14
14
  end
15
15
 
16
16
  describe 'authorization' do
17
- it "sets the Bearer Auth header correctly" do
17
+ it 'sets the Bearer Auth header correctly' do
18
18
  VCR.use_cassette("categories") do
19
19
  response = instance.get_categories(budget_id)
20
20
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -22,7 +22,7 @@ describe 'categories' do
22
22
  end
23
23
  end
24
24
 
25
- it "throws when unauthorized" do
25
+ it 'throws when unauthorized' do
26
26
  VCR.use_cassette("categories_unauthorized") do
27
27
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
28
28
  begin
@@ -36,7 +36,7 @@ describe 'categories' do
36
36
  end
37
37
 
38
38
  describe 'GET /budgets/{budget_id}/categories' do
39
- it "returns a list of categories" do
39
+ it 'returns a list of categories' do
40
40
  VCR.use_cassette("categories") do
41
41
  response = instance.get_categories(budget_id)
42
42
  expect(client.last_request.response.options[:code]).to be 200
@@ -47,7 +47,7 @@ describe 'categories' do
47
47
  end
48
48
 
49
49
  describe 'GET /budgets/{budget_id}/categories/{category_id}' do
50
- it "returns a category" do
50
+ it 'returns a category' do
51
51
  VCR.use_cassette("category") do
52
52
  response = instance.get_category_by_id(budget_id, category_id)
53
53
  expect(response.data.category).to be
@@ -57,7 +57,7 @@ describe 'categories' do
57
57
  end
58
58
 
59
59
  describe 'PATCH /budgets/{budget_id}/months/{month}/categories/{category_id}' do
60
- it "returns a category" do
60
+ it 'returns a category' do
61
61
  VCR.use_cassette("patch_month_category") do
62
62
  response = instance.update_month_category(budget_id, '2018-02-01', category_id, month_category: { budgeted: 20382 })
63
63
  expect(response.data.category).to be
@@ -13,7 +13,7 @@ describe 'months' do
13
13
  end
14
14
 
15
15
  describe 'authorization' do
16
- it "sets the Bearer Auth header correctly" do
16
+ it 'sets the Bearer Auth header correctly' do
17
17
  VCR.use_cassette("months") do
18
18
  response = instance.get_budget_months(budget_id)
19
19
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -21,7 +21,7 @@ describe 'months' do
21
21
  end
22
22
  end
23
23
 
24
- it "throws when unauthorized" do
24
+ it 'throws when unauthorized' do
25
25
  VCR.use_cassette("months_unauthorized") do
26
26
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
@@ -35,7 +35,7 @@ describe 'months' do
35
35
  end
36
36
 
37
37
  describe 'GET /budgets/{budget_id}/months' do
38
- it "returns a list of months" do
38
+ it 'returns a list of months' do
39
39
  VCR.use_cassette("months") do
40
40
  response = instance.get_budget_months(budget_id)
41
41
  expect(client.last_request.response.options[:code]).to be 200
@@ -45,7 +45,7 @@ describe 'months' do
45
45
  end
46
46
 
47
47
  describe 'GET /budgets/{budget_id}/months/{month}' do
48
- it "returns a month" do
48
+ it 'returns a month' do
49
49
  VCR.use_cassette("month") do
50
50
  response = instance.get_budget_month(budget_id, '2018-02-01')
51
51
  expect(response.data.month).to be
@@ -13,7 +13,7 @@ describe 'payee locations' do
13
13
  end
14
14
 
15
15
  describe 'authorization' do
16
- it "sets the Bearer Auth header correctly" do
16
+ it 'sets the Bearer Auth header correctly' do
17
17
  VCR.use_cassette("payee_locations") do
18
18
  response = instance.get_payee_locations(budget_id)
19
19
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -21,7 +21,7 @@ describe 'payee locations' do
21
21
  end
22
22
  end
23
23
 
24
- it "throws when unauthorized" do
24
+ it 'throws when unauthorized' do
25
25
  VCR.use_cassette("payee_locations_unauthorized") do
26
26
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
@@ -35,7 +35,7 @@ describe 'payee locations' do
35
35
  end
36
36
 
37
37
  describe 'GET /budgets/{budget_id}/payee_location' do
38
- it "returns a list of payee locations" do
38
+ it 'returns a list of payee locations' do
39
39
  VCR.use_cassette("payee_locations") do
40
40
  response = instance.get_payee_locations(budget_id)
41
41
  expect(client.last_request.response.options[:code]).to be 200
@@ -45,7 +45,7 @@ describe 'payee locations' do
45
45
  end
46
46
 
47
47
  describe 'GET /budgets/{budget_id}/payee_locations/{payee_id}' do
48
- it "returns a payee location" do
48
+ it 'returns a payee location' do
49
49
  VCR.use_cassette("payee_location") do
50
50
  response = instance.get_payee_location_by_id(budget_id, '052c7814-1797-44ce-9519-020e864e4928')
51
51
  expect(response.data.payee_location).to be
@@ -13,7 +13,7 @@ describe 'payees' do
13
13
  end
14
14
 
15
15
  describe 'authorization' do
16
- it "sets the Bearer Auth header correctly" do
16
+ it 'sets the Bearer Auth header correctly' do
17
17
  VCR.use_cassette("payees") do
18
18
  response = instance.get_payees(budget_id)
19
19
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -21,7 +21,7 @@ describe 'payees' do
21
21
  end
22
22
  end
23
23
 
24
- it "throws when unauthorized" do
24
+ it 'throws when unauthorized' do
25
25
  VCR.use_cassette("payees_unauthorized") do
26
26
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
@@ -35,7 +35,7 @@ describe 'payees' do
35
35
  end
36
36
 
37
37
  describe 'GET /budgets/{budget_id}/payees' do
38
- it "returns a list of payees" do
38
+ it 'returns a list of payees' do
39
39
  VCR.use_cassette("payees") do
40
40
  response = instance.get_payees(budget_id)
41
41
  expect(client.last_request.response.options[:code]).to be 200
@@ -45,7 +45,7 @@ describe 'payees' do
45
45
  end
46
46
 
47
47
  describe 'GET /budgets/{budget_id}/payees/{payee_id}' do
48
- it "returns a payee" do
48
+ it 'returns a payee' do
49
49
  VCR.use_cassette("payee") do
50
50
  response = instance.get_payee_by_id(budget_id, '200e6eb1-02fc-4af6-be26-27c5740bb949')
51
51
  expect(response.data.payee).to be
@@ -13,7 +13,7 @@ describe 'scheduled transactions' do
13
13
  end
14
14
 
15
15
  describe 'authorization' do
16
- it "sets the Bearer Auth header correctly" do
16
+ it 'sets the Bearer Auth header correctly' do
17
17
  VCR.use_cassette("scheduled_transactions") do
18
18
  response = instance.get_scheduled_transactions(budget_id)
19
19
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -21,7 +21,7 @@ describe 'scheduled transactions' do
21
21
  end
22
22
  end
23
23
 
24
- it "throws when unauthorized" do
24
+ it 'throws when unauthorized' do
25
25
  VCR.use_cassette("scheduled_transactions_unauthorized") do
26
26
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
@@ -35,7 +35,7 @@ describe 'scheduled transactions' do
35
35
  end
36
36
 
37
37
  describe 'GET /budgets/{budget_id}/transactions' do
38
- it "returns a list of transactions" do
38
+ it 'returns a list of transactions' do
39
39
  VCR.use_cassette("scheduled_transactions") do
40
40
  response = instance.get_scheduled_transactions(budget_id)
41
41
  expect(client.last_request.response.options[:code]).to be 200
@@ -45,7 +45,7 @@ describe 'scheduled transactions' do
45
45
  end
46
46
 
47
47
  describe 'GET /budgets/{budget_id}/transaction/{payee_id}' do
48
- it "returns a payee" do
48
+ it 'returns a payee' do
49
49
  VCR.use_cassette("scheduled_transaction") do
50
50
  response = instance.get_scheduled_transaction_by_id(budget_id, '1a8e4929-3ad1-4859-8443-2aeeab0684ab')
51
51
  expect(response.data.scheduled_transaction).to be
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'pp'
3
2
 
4
3
  describe 'transactions' do
5
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
@@ -16,7 +15,7 @@ describe 'transactions' do
16
15
  end
17
16
 
18
17
  describe 'authorization' do
19
- it "sets the Bearer Auth header correctly" do
18
+ it 'sets the Bearer Auth header correctly' do
20
19
  VCR.use_cassette("transactions") do
21
20
  response = instance.get_transactions(budget_id)
22
21
  expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}"
@@ -24,7 +23,7 @@ describe 'transactions' do
24
23
  end
25
24
  end
26
25
 
27
- it "throws when unauthorized" do
26
+ it 'throws when unauthorized' do
28
27
  VCR.use_cassette("transactions_unauthorized") do
29
28
  client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
30
29
  begin
@@ -38,7 +37,7 @@ describe 'transactions' do
38
37
  end
39
38
 
40
39
  describe 'GET /budgets/{budget_id}/transactions' do
41
- it "returns a list of transactions" do
40
+ it 'returns a list of transactions' do
42
41
  VCR.use_cassette("transactions") do
43
42
  response = instance.get_transactions(budget_id)
44
43
  expect(client.last_request.response.options[:code]).to be 200
@@ -48,7 +47,7 @@ describe 'transactions' do
48
47
  end
49
48
 
50
49
  describe 'GET /budgets/{budget_id}/category/{category_id}/transactions' do
51
- it "returns a list of transactions for a category" do
50
+ it 'returns a list of transactions for a category' do
52
51
  VCR.use_cassette("category_transactions") do
53
52
  response = instance.get_transactions_by_category(budget_id, category_id)
54
53
  expect(client.last_request.response.options[:code]).to be 200
@@ -58,7 +57,7 @@ describe 'transactions' do
58
57
  end
59
58
 
60
59
  describe 'GET /budgets/{budget_id}/category/{payee_id}/transactions' do
61
- it "returns a list of transactions for a payee" do
60
+ it 'returns a list of transactions for a payee' do
62
61
  VCR.use_cassette("payee_transactions") do
63
62
  response = instance.get_transactions_by_payee(budget_id, payee_id)
64
63
  expect(client.last_request.response.options[:code]).to be 200
@@ -68,7 +67,7 @@ describe 'transactions' do
68
67
  end
69
68
 
70
69
  describe 'GET /budgets/{budget_id}/transaction/{transaction_id}' do
71
- it "returns a transaction" do
70
+ it 'returns a transaction' do
72
71
  VCR.use_cassette("transaction") do
73
72
  response = instance.get_transaction_by_id(budget_id, '81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4')
74
73
  expect(response.data.transaction).to be
@@ -78,7 +77,7 @@ describe 'transactions' do
78
77
  end
79
78
 
80
79
  describe 'POST /budgets/{budget_id}/transactions' do
81
- it "creates a transaction" do
80
+ it 'creates a transaction' do
82
81
  VCR.use_cassette("create_transaction") do
83
82
  response = instance.create_transaction(budget_id, {
84
83
  transaction: {
@@ -93,7 +92,7 @@ describe 'transactions' do
93
92
  end
94
93
  end
95
94
 
96
- it "creates multiple transactions" do
95
+ it 'creates multiple transactions' do
97
96
  VCR.use_cassette("create_transaction") do
98
97
  response = instance.create_transactions(budget_id, {
99
98
  transactions: [
@@ -117,7 +116,7 @@ describe 'transactions' do
117
116
  end
118
117
 
119
118
  describe 'PUT /budgets/{budget_id}/transactions/{transaction_id}' do
120
- it "updates a transaction" do
119
+ it 'updates a transaction' do
121
120
  VCR.use_cassette("update_transaction") do
122
121
  response = instance.update_transaction(budget_id, '4cd63d34-3814-4f50-abd0-59ce05b40d91', {
123
122
  transaction: {
@@ -134,7 +133,7 @@ describe 'transactions' do
134
133
  end
135
134
 
136
135
  describe 'PATCH /budgets/{budget_id}/transactions' do
137
- it "updates multiple transactions" do
136
+ it 'updates multiple transactions' do
138
137
  VCR.use_cassette("update_transactions") do
139
138
  response = instance.update_transactions(budget_id, {
140
139
  transactions: [
@@ -158,7 +157,7 @@ describe 'transactions' do
158
157
  end
159
158
 
160
159
  describe 'POST /budgets/{budget_id}/transactions' do
161
- it "create multiple transactions" do
160
+ it 'create multiple transactions' do
162
161
  VCR.use_cassette("multiple_transactions") do
163
162
  response = instance.create_transaction(budget_id, {
164
163
  transactions: [
@@ -189,7 +188,7 @@ describe 'transactions' do
189
188
  end
190
189
 
191
190
  describe 'POST /budgets/{budget_id}/transactions/import' do
192
- it "import transactions" do
191
+ it 'import transactions' do
193
192
  VCR.use_cassette("import_transactions") do
194
193
  response = instance.import_transactions(budget_id)
195
194
  expect(client.last_request.response.options[:code]).to be 201
@@ -200,7 +199,7 @@ describe 'transactions' do
200
199
  end
201
200
 
202
201
  describe 'POST /budgets/{budget_id}/transactions/bulk' do
203
- it "bulk creations transactions" do
202
+ it 'bulk creations transactions' do
204
203
  VCR.use_cassette("bulk_transactions") do
205
204
  response = instance.bulk_create_transactions(budget_id, {
206
205
  transactions: [
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"account":{"name":"New Checking Account","type":"checking","balance":215000}}'
9
+ headers:
10
+ User-Agent:
11
+ - api_client/ruby/1.19.0
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ Authorization:
17
+ - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045
18
+ Expect:
19
+ - ''
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ X-Frame-Options:
30
+ - deny
31
+ Vary:
32
+ - Accept-Encoding, Origin
33
+ ETag:
34
+ - W/"8b7ba673cfda40fd762ec996f0c8e515"
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - b651ff3a-84d3-4f3a-b83d-e5738cfd8507
39
+ X-Runtime:
40
+ - '0.293182'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"data":{"account":{"id":"77d219fc-51e9-415e-89b4-e0d893529580","name":"New
46
+ Checking Account","type":"checking","on_budget":true,"closed":false,"note":null,"balance":215000,"cleared_balance":215000,"uncleared_balance":0,"transfer_payee_id":"50031af4-c7b0-4a97-a202-daeccf8e0b2f","deleted":false},"server_knowledge":45}}'
47
+ http_version: '1.1'
48
+ adapter_metadata:
49
+ effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts
50
+ recorded_at: Wed, 12 Aug 2020 15:04:29 GMT
51
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ynab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - You Need A Budget, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -161,6 +161,8 @@ files:
161
161
  - lib/ynab/models/payee_response_data.rb
162
162
  - lib/ynab/models/payees_response.rb
163
163
  - lib/ynab/models/payees_response_data.rb
164
+ - lib/ynab/models/save_account.rb
165
+ - lib/ynab/models/save_account_wrapper.rb
164
166
  - lib/ynab/models/save_category_response.rb
165
167
  - lib/ynab/models/save_category_response_data.rb
166
168
  - lib/ynab/models/save_month_category.rb
@@ -214,6 +216,7 @@ files:
214
216
  - spec/fixtures/vcr_cassettes/categories_unauthorized.yml
215
217
  - spec/fixtures/vcr_cassettes/category.yml
216
218
  - spec/fixtures/vcr_cassettes/category_transactions.yml
219
+ - spec/fixtures/vcr_cassettes/create_account.yml
217
220
  - spec/fixtures/vcr_cassettes/create_transaction.yml
218
221
  - spec/fixtures/vcr_cassettes/create_transactions.yml
219
222
  - spec/fixtures/vcr_cassettes/import_transactions.yml
@@ -306,5 +309,6 @@ test_files:
306
309
  - spec/fixtures/vcr_cassettes/month.yml
307
310
  - spec/fixtures/vcr_cassettes/categories_unauthorized.yml
308
311
  - spec/fixtures/vcr_cassettes/transactions_unauthorized.yml
312
+ - spec/fixtures/vcr_cassettes/create_account.yml
309
313
  - spec/models/transaction_detail_spec.rb
310
314
  - spec/spec_helper.rb