finapps 5.0.7 → 5.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab24b272e6e171ea6c7ad7d9ca7959b6956ae5c8517038d5f840e5192eb986f1
4
- data.tar.gz: fc9ec00111fabfe80f88bffd7dcc7fcb58f6295af88141b733c221c8e14bb31a
3
+ metadata.gz: 8649be674c821b90c09a46379fd7aef455ca72fe0132098dd31ee20cd0253aed
4
+ data.tar.gz: cbf53968080c0e7b5d3fc57dd407a8432eb8f6d6b458bdae3e79fde4b272cf26
5
5
  SHA512:
6
- metadata.gz: 6d5b36a60fd530326606774e61b359a8b139413474b9154b10ea1eb3631d705487e8691b8c2688cc5a5766de3cde88662c6c741b5ad6066b81235c728136c10f
7
- data.tar.gz: 12c432b8e6ee664fa19248860caa8bee028ea1d2af7c167474b3417879011576b922cee932d20e33cc69813b41676922d7bcceb0aa975cb3e346d98f68320322
6
+ metadata.gz: d6dacf98bbd260391a83a555f9ea40c03dfdda6ccc77ca8cf305ff0646f487baaa3b3c8b326410037c0b47f0b2a702f1e0b1936f3b69d6a23385d1cef927d6a2
7
+ data.tar.gz: 3c444a8a58f341b1e7b3ea173d4c777a11f448fc6a27015518ff0385ee61b5c87a0ffd7722db94e07109174c2bb9fcbd412046a05d8f8e88d09ade3c49f120a3
data/.gitignore CHANGED
@@ -31,3 +31,8 @@ mkmf.log
31
31
 
32
32
  # vim swap files
33
33
  *.swp
34
+
35
+ # node_modules
36
+ node_modules/
37
+ package.json
38
+ yarn.lock
data/finapps.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.2'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.3'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
@@ -7,9 +7,13 @@ module FinApps
7
7
  super(params, 'p/institution/consumer')
8
8
  end
9
9
 
10
+ def show(id)
11
+ super nil, "p/institution/consumer/#{id}"
12
+ end
13
+
10
14
  def list
11
15
  super 'p/institution/consumer'
12
16
  end
13
17
  end
14
18
  end
15
- end
19
+ end
@@ -6,7 +6,7 @@ module FinApps
6
6
  protected
7
7
 
8
8
  def end_point
9
- super.gsub!('plaid', 'p/')
9
+ super.gsub('plaid', 'p/')
10
10
  end
11
11
  end
12
12
  end
@@ -15,12 +15,14 @@ module FinApps
15
15
  begin
16
16
  super params, path
17
17
  rescue FinAppsCore::ApiUnauthenticatedError
18
- return [
19
- nil,
18
+ return(
20
19
  [
21
- "Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"
20
+ nil,
21
+ [
22
+ "Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"
23
+ ]
22
24
  ]
23
- ]
25
+ )
24
26
  end
25
27
  end
26
28
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.7'
4
+ VERSION = '5.0.8'
5
5
  end
@@ -23,9 +23,7 @@ RSpec.describe FinApps::REST::Consumers,
23
23
  let(:create) { subject.create(email: 'email', password: 'password') }
24
24
 
25
25
  it { expect { create }.not_to raise_error }
26
- it('results is a Hash') do
27
- expect(results).to be_a(Hash)
28
- end
26
+ it('results is a Hash') { expect(results).to be_a(Hash) }
29
27
  it('performs a post and returns the response') do
30
28
  expect(results).to have_key(:public_id)
31
29
  end
@@ -59,9 +57,7 @@ RSpec.describe FinApps::REST::Consumers,
59
57
  let(:error_messages) { show[1] }
60
58
 
61
59
  it { expect { show }.not_to raise_error }
62
- it('results is a Hash') do
63
- expect(results).to be_a(Hash)
64
- end
60
+ it('results is a Hash') { expect(results).to be_a(Hash) }
65
61
  it('performs a get and returns the response') do
66
62
  expect(results).to have_key(:public_id)
67
63
  end
@@ -131,9 +127,7 @@ RSpec.describe FinApps::REST::Consumers,
131
127
  let(:error_messages) { update[1] }
132
128
 
133
129
  it { expect { update }.not_to raise_error }
134
- it('results is a Hash') do
135
- expect(results).to be_a(Hash)
136
- end
130
+ it('results is a Hash') { expect(results).to be_a(Hash) }
137
131
  it('the public_id is on the results') do
138
132
  expect(results).to have_key(:public_id)
139
133
  end
@@ -23,9 +23,7 @@ RSpec.describe FinApps::REST::OrderTokens,
23
23
  context 'for valid token' do
24
24
  let(:show) { subject.show(:valid_token) }
25
25
  it { expect { show }.not_to raise_error }
26
- it('results is a Hashie::Rash') do
27
- expect(results).to be_a(Hash)
28
- end
26
+ it('results is a Hash') { expect(results).to be_a(Hash) }
29
27
  it('results contains a consumer_id') do
30
28
  expect(results).to have_key(:consumer_id)
31
29
  end
@@ -9,68 +9,60 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
9
9
  let(:api_client) { client }
10
10
 
11
11
  RSpec.shared_examples 'an API request' do |_parameter|
12
- # noinspection RubyBlockToMethodReference
13
- it { expect { subject }.not_to raise_error }
12
+ it do
13
+ expect do
14
+ # noinspection RubyBlockToMethodReference
15
+ subject
16
+ end.not_to raise_error
17
+ end
14
18
  it('returns an array') { expect(subject).to be_a(Array) }
15
19
  end
16
20
 
17
- describe '#create' do
18
- subject(:create) do
19
- FinApps::REST::PlaidConsumerInstitutions
20
- .new(api_client)
21
- .create(public_token: 'le-token')
21
+ RSpec.shared_examples 'a successful request' do |_parameter|
22
+ it('returns no error messages') do
23
+ expect(subject[ERROR_MESSAGES]).to be_empty
22
24
  end
25
+ end
23
26
 
24
- context 'when valid tenant token is provided' do
25
- it_behaves_like 'an API request'
27
+ RSpec.shared_examples 'a request that returns institution data' do |_parameter|
28
+ it('returns institution data') do
29
+ expect(subject[RESULTS]).to have_key(:_id)
30
+ end
31
+ end
26
32
 
27
- it('performs a post and returns information about the institution') do
28
- expect(create[RESULTS]).to have_key(:_id)
29
- end
30
- it('returns no error messages') do
31
- expect(create[ERROR_MESSAGES]).to be_empty
32
- end
33
+ describe '#create' do
34
+ subject(:create) do
35
+ FinApps::REST::PlaidConsumerInstitutions.new(api_client).create(
36
+ public_token: 'le-token'
37
+ )
33
38
  end
34
39
 
35
- context 'when invalid tenant token is provided' do
36
- let(:api_client) { client(:invalid_tenant_token) }
40
+ it_behaves_like 'an API request'
41
+ it_behaves_like 'a successful request'
42
+ it_behaves_like 'a request that returns institution data'
43
+ end
37
44
 
38
- it_behaves_like 'an API request'
39
- it('results is nil') { expect(create[RESULTS]).to be_nil }
40
- it('error messages array is populated') do
41
- expect(create[ERROR_MESSAGES].first.downcase).to eq('resource not found')
42
- end
45
+ describe '#show' do
46
+ subject(:show) do
47
+ FinApps::REST::PlaidConsumerInstitutions.new(api_client).show(
48
+ :consumer_institution_id
49
+ )
43
50
  end
51
+
52
+ it_behaves_like 'an API request'
53
+ it_behaves_like 'a successful request'
54
+ it_behaves_like 'a request that returns institution data'
44
55
  end
45
56
 
46
57
  describe '#list' do
47
58
  subject(:list) do
48
- FinApps::REST::PlaidConsumerInstitutions
49
- .new(api_client)
50
- .list
59
+ FinApps::REST::PlaidConsumerInstitutions.new(api_client).list
51
60
  end
52
61
 
53
- context 'when valid tenant token is provided' do
54
- it_behaves_like 'an API request'
55
-
56
- it('returns an Array of institution data') do
57
- result = list[RESULTS]
58
- expect(result).to be_an(Array)
59
- expect(result.first).to have_key(:_id)
60
- end
61
- it('returns no error messages') do
62
- expect(list[ERROR_MESSAGES]).to be_empty
63
- end
64
- end
65
-
66
- context 'when invalid tenant token is provided' do
67
- let(:api_client) { client(:invalid_tenant_token) }
68
-
69
- it_behaves_like 'an API request'
70
- it('results is nil') { expect(list[RESULTS]).to be_nil }
71
- it('error messages array is populated') do
72
- expect(list[ERROR_MESSAGES].first.downcase).to eq('resource not found')
73
- end
62
+ it_behaves_like 'an API request'
63
+ it_behaves_like 'a successful request'
64
+ it('returns an Array of institution data') do
65
+ expect(list[RESULTS].first).to have_key(:_id)
74
66
  end
75
67
  end
76
68
  end
@@ -45,12 +45,8 @@ RSpec.describe FinApps::REST::Sessions,
45
45
  { email: 'email@domain.com', password: 'valid_password' }
46
46
  end
47
47
 
48
- it('results is a Hashie::Rash') do
49
- expect(results).to be_a(Hash)
50
- end
51
- it('token value is in the result') do
52
- expect(results).to have_key(:token)
53
- end
48
+ it('results is a Hash') { expect(results).to be_a(Hash) }
49
+ it('token value is in the result') { expect(results).to have_key(:token) }
54
50
  it('error_messages is empty') { expect(error_messages).to be_empty }
55
51
  end
56
52
 
@@ -60,12 +56,8 @@ RSpec.describe FinApps::REST::Sessions,
60
56
  { email: 'email@domain.com', password: 'valid_password' }
61
57
  end
62
58
 
63
- it('results is a Hashie::Rash') do
64
- expect(results).to be_a(Hash)
65
- end
66
- it('token value is in the result') do
67
- expect(results).to have_key(:token)
68
- end
59
+ it('results is a Hash') { expect(results).to be_a(Hash) }
60
+ it('token value is in the result') { expect(results).to have_key(:token) }
69
61
  it('returns operator for operator path') do
70
62
  expect(results).to have_key(:role)
71
63
  end
@@ -26,6 +26,9 @@ class FakeApi < Sinatra::Base
26
26
  end
27
27
 
28
28
  # plaid_institution_consumer
29
+ get("/#{version}/p/institution/consumer/:consumer_institution_id") do
30
+ json_response 200, 'plaid/institution/consumer/show.json'
31
+ end
29
32
  get("/#{version}/p/institution/consumer") do
30
33
  tenant_token = request.env['HTTP_X_TENANT_TOKEN']
31
34
  if tenant_token == 'invalid_tenant_token'
@@ -0,0 +1,19 @@
1
+ {
2
+ "_id": "5d435bb8c80c5c00010d88b1",
3
+ "status": 4,
4
+ "status_text": null,
5
+ "error": null,
6
+ "webhook": null,
7
+ "institution_name": "",
8
+ "plaid_institution_id": "",
9
+ "metrics": {
10
+ "available_products": null,
11
+ "billed_products": null,
12
+ "last_webhook": null,
13
+ "last_webhook_code": null,
14
+ "last_successful_transaction_update": null,
15
+ "last_failed_transaction_update": null
16
+ },
17
+ "created_date": "2019-08-01T21:38:00.261008261Z",
18
+ "modified_date": "2019-08-01T21:38:00.261008261Z"
19
+ }
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.7
4
+ version: 5.0.8
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-05 00:00:00.000000000 Z
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.0.2
22
+ version: 5.0.3
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.2
32
+ version: 5.0.3
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -385,6 +385,7 @@ files:
385
385
  - spec/support/fixtures/plaid/institution/consumer/add-missing-public-token.json
386
386
  - spec/support/fixtures/plaid/institution/consumer/add.json
387
387
  - spec/support/fixtures/plaid/institution/consumer/list.json
388
+ - spec/support/fixtures/plaid/institution/consumer/show.json
388
389
  - spec/support/fixtures/plaid/webhook.json
389
390
  - spec/support/fixtures/portfolio.json
390
391
  - spec/support/fixtures/portfolio_reports.json