finapps 5.0.13 → 5.0.14
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.
- checksums.yaml +4 -4
- data/lib/finapps/rest/orders.rb +4 -11
- data/lib/finapps/rest/plaid/plaid_account_permissions.rb +2 -2
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/orders_spec.rb +4 -23
- data/spec/support/fake_api.rb +3 -11
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c88358c623ea2ab28b48c290cea3245bee6896aa105ef411e881ca01c80b31c9
|
4
|
+
data.tar.gz: c40ecae6c8ba2a5472b2b80325cf4ebf912a06cdedb6d75e05fe77a3994f272d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ac883b52219e1fa3dc5acda80bfa37268e4c04b61bc6d604320357ed46b8b35665931a85769eb7b6d4ce7473db7957eff19d58622564106c28ba2c9fab5acf
|
7
|
+
data.tar.gz: 1c85b4ae3ea37cfe915efa193248c094c385efbe099f860efd639cc8760b299aa541665e7c7a8d30892d63ea51ed89600e36dd2b2f0ad21a63105f9729ec97ed
|
data/lib/finapps/rest/orders.rb
CHANGED
@@ -33,25 +33,18 @@ module FinApps
|
|
33
33
|
super build_query_path(end_point, params)
|
34
34
|
end
|
35
35
|
|
36
|
-
def update(id
|
37
|
-
return super nil, path if path
|
38
|
-
|
36
|
+
def update(id)
|
39
37
|
not_blank(id, :id)
|
40
|
-
not_blank(params, :params)
|
41
|
-
# Params array need matching Institution ids & Account ids
|
42
|
-
# Validations to check each Institution id has at least one account id
|
43
|
-
# Validations to check at least 1 Institution id or 1 account "params.length >= 1"
|
44
|
-
|
45
38
|
path = "#{end_point}/#{ERB::Util.url_encode(id)}"
|
46
39
|
|
47
|
-
super
|
40
|
+
super nil, path
|
48
41
|
end
|
49
42
|
|
50
43
|
def destroy(id)
|
51
44
|
not_blank(id, :id)
|
52
|
-
|
53
45
|
path = "#{end_point}/#{ERB::Util.url_encode(id)}/cancel"
|
54
|
-
|
46
|
+
|
47
|
+
send_request path, :put
|
55
48
|
end
|
56
49
|
|
57
50
|
private
|
@@ -4,11 +4,11 @@ module FinApps
|
|
4
4
|
module REST
|
5
5
|
class PlaidAccountPermissions < PlaidResources # :nodoc:
|
6
6
|
def create(id)
|
7
|
-
send_request 'p/accounts/permissions', :put,
|
7
|
+
send_request 'p/accounts/permissions', :put, [id]
|
8
8
|
end
|
9
9
|
|
10
10
|
def destroy(id)
|
11
|
-
send_request 'p/accounts/permissions', :delete,
|
11
|
+
send_request 'p/accounts/permissions', :delete, [id]
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/finapps/version.rb
CHANGED
data/spec/rest/orders_spec.rb
CHANGED
@@ -151,21 +151,14 @@ RSpec.describe FinApps::REST::Orders do
|
|
151
151
|
subject(:orders) { FinApps::REST::Orders.new(client) }
|
152
152
|
|
153
153
|
context 'when missing id' do
|
154
|
-
let(:update) { subject.update(nil
|
154
|
+
let(:update) { subject.update(nil) }
|
155
155
|
it('returns missing argument error') do
|
156
156
|
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
-
context 'when
|
161
|
-
let(:update) { subject.update(
|
162
|
-
it('returns missing argument error') do
|
163
|
-
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
context 'when valid id and params are provided' do
|
168
|
-
let(:update) { subject.update('valid_id', accounts: 'valid_account') } # how to stub params
|
160
|
+
context 'when valid id is provided' do
|
161
|
+
let(:update) { subject.update('valid_id') } # how to stub params
|
169
162
|
let(:results) { update[RESULTS] }
|
170
163
|
let(:error_messages) { update[ERROR_MESSAGES] }
|
171
164
|
|
@@ -175,7 +168,7 @@ RSpec.describe FinApps::REST::Orders do
|
|
175
168
|
end
|
176
169
|
|
177
170
|
context 'when invalid id is provided' do
|
178
|
-
let(:update) { subject.update('invalid_id'
|
171
|
+
let(:update) { subject.update('invalid_id') }
|
179
172
|
let(:results) { update[RESULTS] }
|
180
173
|
let(:error_messages) { update[ERROR_MESSAGES] }
|
181
174
|
|
@@ -185,18 +178,6 @@ RSpec.describe FinApps::REST::Orders do
|
|
185
178
|
expect(error_messages.first.downcase).to eq('resource not found')
|
186
179
|
end
|
187
180
|
end
|
188
|
-
|
189
|
-
context 'when invalid params are provided' do
|
190
|
-
let(:update) { subject.update('valid_id', accounts: 'invalid_account') }
|
191
|
-
let(:results) { update[RESULTS] }
|
192
|
-
let(:error_messages) { update[ERROR_MESSAGES] }
|
193
|
-
|
194
|
-
it { expect { update }.not_to raise_error }
|
195
|
-
it('results is nil') { expect(results).to be_nil }
|
196
|
-
it('error messages array is populated') do
|
197
|
-
expect(error_messages.first.downcase).to eq('invalid request body')
|
198
|
-
end
|
199
|
-
end
|
200
181
|
end
|
201
182
|
|
202
183
|
describe '#destroy' do
|
data/spec/support/fake_api.rb
CHANGED
@@ -59,7 +59,7 @@ class FakeApi < Sinatra::Base
|
|
59
59
|
put("/#{version}/p/accounts/permissions") do
|
60
60
|
request.body.rewind
|
61
61
|
request_payload = JSON.parse request.body.read
|
62
|
-
if request_payload.
|
62
|
+
if request_payload.is_a? Array
|
63
63
|
status 204
|
64
64
|
else
|
65
65
|
json_response 400, 'invalid_request_body.json'
|
@@ -68,7 +68,7 @@ class FakeApi < Sinatra::Base
|
|
68
68
|
delete("/#{version}/p/accounts/permissions") do
|
69
69
|
request.body.rewind
|
70
70
|
request_payload = JSON.parse request.body.read
|
71
|
-
if request_payload.
|
71
|
+
if request_payload.is_a? Array
|
72
72
|
status 204
|
73
73
|
else
|
74
74
|
json_response 400, 'invalid_request_body.json'
|
@@ -142,15 +142,7 @@ class FakeApi < Sinatra::Base
|
|
142
142
|
put("/#{version}/orders/invalid_id") do
|
143
143
|
json_response 404, 'resource_not_found.json'
|
144
144
|
end
|
145
|
-
put("/#{version}/orders/valid_id")
|
146
|
-
request.body.rewind
|
147
|
-
request_payload = JSON.parse request.body.read
|
148
|
-
if request_payload['accounts'] == 'valid_account'
|
149
|
-
status 204
|
150
|
-
else
|
151
|
-
json_response 400, 'invalid_request_body.json'
|
152
|
-
end
|
153
|
-
end
|
145
|
+
put("/#{version}/orders/valid_id") { status 204 }
|
154
146
|
post("/#{version}/orders") do
|
155
147
|
request.body.rewind
|
156
148
|
request_payload = JSON.parse request.body.read
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -442,38 +442,38 @@ signing_key:
|
|
442
442
|
specification_version: 4
|
443
443
|
summary: FinApps REST API ruby client.
|
444
444
|
test_files:
|
445
|
-
- spec/rest/
|
446
|
-
- spec/rest/consumers_portfolios_spec.rb
|
447
|
-
- spec/rest/operators_password_resets_spec.rb
|
448
|
-
- spec/rest/portfolios_available_consumers_spec.rb
|
449
|
-
- spec/rest/products_spec.rb
|
450
|
-
- spec/rest/statements_spec.rb
|
445
|
+
- spec/rest/portfolios_alerts_spec.rb
|
451
446
|
- spec/rest/alert_definitions_spec.rb
|
452
|
-
- spec/rest/
|
453
|
-
- spec/rest/
|
454
|
-
- spec/rest/
|
455
|
-
- spec/rest/
|
447
|
+
- spec/rest/portfolios_consumers_spec.rb
|
448
|
+
- spec/rest/plaid/plaid_accounts_spec.rb
|
449
|
+
- spec/rest/plaid/plaid_webhooks_spec.rb
|
450
|
+
- spec/rest/plaid/plaid_account_permissions_spec.rb
|
451
|
+
- spec/rest/plaid/plaid_consumer_institutions_spec.rb
|
452
|
+
- spec/rest/order_assignments_spec.rb
|
453
|
+
- spec/rest/tenant_settings_spec.rb
|
456
454
|
- spec/rest/tenant_app_settings_spec.rb
|
457
|
-
- spec/rest/operators_spec.rb
|
458
455
|
- spec/rest/client_spec.rb
|
459
|
-
- spec/rest/
|
460
|
-
- spec/rest/
|
461
|
-
- spec/rest/alert_occurrences_spec.rb
|
456
|
+
- spec/rest/portfolio_reports_spec.rb
|
457
|
+
- spec/rest/version_spec.rb
|
462
458
|
- spec/rest/password_resets_spec.rb
|
459
|
+
- spec/rest/operators_spec.rb
|
460
|
+
- spec/rest/order_statuses_spec.rb
|
461
|
+
- spec/rest/alert_occurrences_spec.rb
|
463
462
|
- spec/rest/order_reports_spec.rb
|
463
|
+
- spec/rest/portfolios_available_consumers_spec.rb
|
464
|
+
- spec/rest/consumers_spec.rb
|
465
|
+
- spec/rest/sessions_spec.rb
|
466
|
+
- spec/rest/orders_spec.rb
|
467
|
+
- spec/rest/operators_password_resets_spec.rb
|
464
468
|
- spec/rest/portfolios_spec.rb
|
465
|
-
- spec/rest/order_statuses_spec.rb
|
466
|
-
- spec/rest/plaid/plaid_accounts_spec.rb
|
467
|
-
- spec/rest/plaid/plaid_account_permissions_spec.rb
|
468
|
-
- spec/rest/plaid/plaid_webhooks_spec.rb
|
469
|
-
- spec/rest/plaid/plaid_consumer_institutions_spec.rb
|
470
469
|
- spec/rest/order_refreshes_spec.rb
|
471
470
|
- spec/rest/order_notifications_spec.rb
|
472
|
-
- spec/rest/
|
473
|
-
- spec/rest/
|
474
|
-
- spec/rest/
|
475
|
-
- spec/rest/
|
476
|
-
- spec/
|
471
|
+
- spec/rest/statements_spec.rb
|
472
|
+
- spec/rest/api_request.rb
|
473
|
+
- spec/rest/order_tokens_spec.rb
|
474
|
+
- spec/rest/consumers_portfolios_spec.rb
|
475
|
+
- spec/rest/products_spec.rb
|
477
476
|
- spec/utils/query_builder_spec.rb
|
478
|
-
- spec/
|
477
|
+
- spec/support/fake_api.rb
|
479
478
|
- spec/spec_helper.rb
|
479
|
+
- spec/spec_helpers/client.rb
|