finapps 5.0.5 → 5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/finapps.rb +1 -0
- data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +1 -1
- data/lib/finapps/rest/plaid/plaid_resources.rb +13 -0
- data/lib/finapps/rest/plaid/plaid_webhooks.rb +3 -3
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/plaid/plaid_webhooks_spec.rb +10 -9
- data/spec/support/fake_api.rb +2 -2
- data/spec/support/fixtures/invalid_tenant_credentials.json +5 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a1641f0fe296f8026dbe5423f23b0c521bb0dd7722657f7c46bdeb06fa2fbf2
|
4
|
+
data.tar.gz: 818dd5f516d402ce3ffada206dac6a48531de84b998a031d7b466b9e89d8f5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8088f973f6d1841f1d67b654811a91e795347198fd05c7ec7d82d69d816ff09d09b48ea02d646ffd659a76fef57d88d85f9c0a62f396a442103b127193c79126
|
7
|
+
data.tar.gz: 4391a7c8b7851baa3ffd4338522277d00f00c24964d04b93b1743cb58edab98992e7dbcbfea7f70db1546941d7d959f47e3aa7a0e1433164e08070e5128094d6
|
data/lib/finapps.rb
CHANGED
@@ -31,6 +31,7 @@ require 'finapps/rest/portfolios_consumers'
|
|
31
31
|
require 'finapps/rest/consumers_portfolios'
|
32
32
|
require 'finapps/rest/portfolio_reports'
|
33
33
|
|
34
|
+
require 'finapps/rest/plaid/plaid_resources'
|
34
35
|
require 'finapps/rest/plaid/plaid_webhooks'
|
35
36
|
require 'finapps/rest/plaid/plaid_consumer_institutions'
|
36
37
|
|
data/lib/finapps/version.rb
CHANGED
@@ -6,22 +6,22 @@ RSpec.describe FinApps::REST::PlaidWebhooks do
|
|
6
6
|
include SpecHelpers::Client
|
7
7
|
|
8
8
|
let(:api_client) { client }
|
9
|
-
subject(:
|
9
|
+
subject(:show) { FinApps::REST::PlaidWebhooks.new(api_client).show }
|
10
10
|
|
11
|
-
describe '#
|
11
|
+
describe '#show' do
|
12
12
|
RSpec.shared_examples 'an API request' do |_parameter|
|
13
|
-
it { expect {
|
14
|
-
it('returns an array') { expect(
|
13
|
+
it { expect { show }.not_to raise_error }
|
14
|
+
it('returns an array') { expect(show).to be_a(Array) }
|
15
15
|
end
|
16
16
|
|
17
17
|
context 'when valid tenant token is provided' do
|
18
18
|
it_behaves_like 'an API request'
|
19
19
|
|
20
20
|
it('performs a post and returns the webhook url') do
|
21
|
-
expect(
|
21
|
+
expect(show[RESULTS]).to have_key(:url)
|
22
22
|
end
|
23
23
|
it('returns no error messages') do
|
24
|
-
expect(
|
24
|
+
expect(show[ERROR_MESSAGES]).to be_empty
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -29,10 +29,11 @@ RSpec.describe FinApps::REST::PlaidWebhooks do
|
|
29
29
|
let(:api_client) { client(:invalid_tenant_token) }
|
30
30
|
|
31
31
|
it_behaves_like 'an API request'
|
32
|
-
|
32
|
+
|
33
|
+
it('results is nil') { expect(show[RESULTS]).to be_nil }
|
33
34
|
it('error messages array is populated') do
|
34
|
-
expect(
|
35
|
-
'
|
35
|
+
expect(show[ERROR_MESSAGES].first.downcase).to eq(
|
36
|
+
'invalid tenant api key or secret'
|
36
37
|
)
|
37
38
|
end
|
38
39
|
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -16,10 +16,10 @@ class FakeApi < Sinatra::Base
|
|
16
16
|
delete("/#{version}/resources/:id") { status 202 }
|
17
17
|
|
18
18
|
# plaid_webhook
|
19
|
-
|
19
|
+
get("/#{version}/p/webhook") do
|
20
20
|
tenant_token = request.env['HTTP_X_TENANT_TOKEN']
|
21
21
|
if tenant_token == 'invalid_tenant_token'
|
22
|
-
json_response 404, '
|
22
|
+
json_response 404, 'invalid_tenant_credentials.json'
|
23
23
|
else
|
24
24
|
json_response 200, 'plaid/webhook.json'
|
25
25
|
end
|
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.6
|
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-08-
|
11
|
+
date: 2019-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -313,6 +313,7 @@ files:
|
|
313
313
|
- lib/finapps/rest/orders.rb
|
314
314
|
- lib/finapps/rest/password_resets.rb
|
315
315
|
- lib/finapps/rest/plaid/plaid_consumer_institutions.rb
|
316
|
+
- lib/finapps/rest/plaid/plaid_resources.rb
|
316
317
|
- lib/finapps/rest/plaid/plaid_webhooks.rb
|
317
318
|
- lib/finapps/rest/portfolio_reports.rb
|
318
319
|
- lib/finapps/rest/portfolios.rb
|
@@ -365,6 +366,7 @@ files:
|
|
365
366
|
- spec/support/fixtures/error.json
|
366
367
|
- spec/support/fixtures/fake_pdf_statement.json
|
367
368
|
- spec/support/fixtures/invalid_request_body.json
|
369
|
+
- spec/support/fixtures/invalid_tenant_credentials.json
|
368
370
|
- spec/support/fixtures/invalid_user_id.json
|
369
371
|
- spec/support/fixtures/invalid_user_institution_id.json
|
370
372
|
- spec/support/fixtures/mfa_timeout.json
|