finapps 2.2.10 → 2.2.11

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
  SHA1:
3
- metadata.gz: 70220a731dd2c12887ace4b6d14c1456d56177a1
4
- data.tar.gz: 9066dcd39edf4269383677d0b252b8f8b564ae36
3
+ metadata.gz: a9345f2ee1b07ebc04aaafd850699f01d7410c75
4
+ data.tar.gz: 7f1363fcc09f46ad078f900eccde69d9a007ec74
5
5
  SHA512:
6
- metadata.gz: fa575512298a0cf92d92470394bbe3040948b7b239f728f10ad660f91686ed8227dc7035b7428c02ed4ce97b24baa5e8c26ed58b76bc663d3aa62999976042f8
7
- data.tar.gz: 49cebe455ebe88dc8383a472f6baa60a3e9fa8181f0379f185a29d64fd5bb38cbf07d66aa52dd924b5750478ac2520164ce15b1818b3213982cfe92937f0d1dd
6
+ metadata.gz: 9e0fbdf8e8b2307aaf9a897316c619fc7500969095393605bf8d16537e4b84c5405a797b86d233d2338d803e61f80d8fa73c6abd08c474eb34fd02cd4557cefd
7
+ data.tar.gz: ef218718b47c393cb40a14513dfb14e2e9be8295bef9a7ebe97cb271965c7a5da2986062e5fa1f8ad0f9bb5d128e8bd00f1d56211610c91f5c99a57f18c97606
@@ -9,6 +9,19 @@ module FinApps
9
9
  path = "#{end_point}/search/#{ERB::Util.url_encode(search_term)}"
10
10
  super path
11
11
  end
12
+
13
+ def show(routing_number)
14
+ not_blank(routing_number, :routing_number)
15
+
16
+ path = "#{end_point}/routing/#{remove_non_digits routing_number}"
17
+ super routing_number, path
18
+ end
19
+
20
+ private
21
+
22
+ def remove_non_digits(value)
23
+ value.to_s.gsub(/\D/, '')
24
+ end
12
25
  end
13
26
  end
14
27
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
- VERSION = '2.2.10'
3
+ VERSION = '2.2.11'
4
4
  end
@@ -2,10 +2,9 @@
2
2
  require 'spec_helpers/client'
3
3
  RSpec.describe FinApps::REST::Institutions do
4
4
  include SpecHelpers::Client
5
+ subject(:institutions) { FinApps::REST::Institutions.new(client) }
5
6
 
6
7
  describe '#list' do
7
- subject(:institutions) { FinApps::REST::Institutions.new(client) }
8
-
9
8
  context 'when search_term is missing' do
10
9
  let(:list) { subject.list(nil) }
11
10
  it { expect { list }.to raise_error(FinAppsCore::MissingArgumentsError) }
@@ -20,4 +19,23 @@ RSpec.describe FinApps::REST::Institutions do
20
19
  it('returns no error messages') { expect(list[1]).to be_empty }
21
20
  end
22
21
  end
22
+
23
+ describe '#show' do
24
+ context 'when routing_number is missing' do
25
+ it { expect { subject.show(nil) }.to raise_error(FinAppsCore::MissingArgumentsError) }
26
+ end
27
+
28
+ context 'when proper routing_number is provided' do
29
+ # An ABA routing transit number (ABA RTN) is a nine digit code
30
+ let(:show) { subject.show('999999999') }
31
+
32
+ it { expect { show }.not_to raise_error }
33
+ it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
34
+ it('returns a hash on the results') { expect(show[RESULTS]).to be_a(Hash) }
35
+ it('includes a base_url on the results') { expect(show[RESULTS]).to respond_to(:base_url) }
36
+ it('includes a display_name on the results') { expect(show[RESULTS]).to respond_to(:display_name) }
37
+ it('includes a site_id on the results') { expect(show[RESULTS]).to respond_to(:site_id) }
38
+ it('includes a org_display_name on the results') { expect(show[RESULTS]).to respond_to(:org_display_name) }
39
+ end
40
+ end
23
41
  end
@@ -47,6 +47,7 @@ class FakeApi < Sinatra::Base
47
47
  get('/v2/institutions/site/invalid_site_id/form') { json_response 400, 'invalid_institution_id.json' }
48
48
  post('/v2/institutions/site/valid_site_id/add') { json_response 200, 'institution_add.json' }
49
49
  get('/v2/institutions/search/:search_term') { json_response 200, 'institutions_search_list.json' }
50
+ get('/v2/institutions/routing/:routing_number') { json_response 200, 'institutions_routing_number.json' }
50
51
 
51
52
  # user institutions
52
53
  get('/v2/institutions/consumer/valid_id/status') { json_response 200, 'user_institution_status.json' }
@@ -0,0 +1,6 @@
1
+ {
2
+ "base_url": "https://www.citibank.co.th",
3
+ "display_name": "CITIBANK (Thailand)",
4
+ "site_id": 20638,
5
+ "org_display_name": "Citigroup Inc"
6
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.10
4
+ version: 2.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
@@ -273,6 +273,7 @@ files:
273
273
  - spec/support/fixtures/error.json
274
274
  - spec/support/fixtures/institution_add.json
275
275
  - spec/support/fixtures/institution_login_form.json
276
+ - spec/support/fixtures/institutions_routing_number.json
276
277
  - spec/support/fixtures/institutions_search_list.json
277
278
  - spec/support/fixtures/invalid_institution_id.json
278
279
  - spec/support/fixtures/invalid_request_body.json