finapps 2.0.23 → 2.0.24

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: 5be4f8c24c61d16ba7c0faabfd7a8447457fbc9a
4
- data.tar.gz: 260a063e09e7d8e7a23bfb9cf4e69b1d74dea3e0
3
+ metadata.gz: 459e76ea87b8115a6832116c5fa5244f5074694c
4
+ data.tar.gz: 0ebb05734404029ce95eb67a6ce7b893c2b7435d
5
5
  SHA512:
6
- metadata.gz: 71a91753140914e0a7e01caceedcc11b3b5eb25997c8a46160c97706d23f511fa5dc5707de9762372ed52450ca10a94181c1788115092a7b8a4ea9a2ba372981
7
- data.tar.gz: 6a1347b053c179e48f16b70c8785ccc8dfb5911371c40714ef2d963e4ad504d3ab14a0ebd5366742c7eb2648c2e8f4bf3d0a4989847af0d5fbd0ed92bdcea186
6
+ metadata.gz: 56509e050cfa3f90fd8575bd28c2dd758d7beded369f8f272fd4f181c55cabfcba09a58fe767ff0ac73e3cb5ec6de2ce44e747749e9ecbfd1914917dcef41962
7
+ data.tar.gz: 49b53717825e7c597409f7609f050e6430f10d9ff6bdcda025212409d3afba9f957ed339055915e2c9a2c4a3acd3bf15820c989b140c927bf1155043c598077c
@@ -5,15 +5,6 @@ module FinApps
5
5
  using ObjectExtensions
6
6
  using StringExtensions
7
7
 
8
- def create(site_id, params)
9
- raise MissingArgumentsError.new 'Missing argument: site_id.' if site_id.blank?
10
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
11
-
12
- path = "#{end_point}/site/#{ERB::Util.url_encode(site_id)}/add"
13
-
14
- super params, path
15
- end
16
-
17
8
  def list(search_term)
18
9
  raise MissingArgumentsError.new 'Missing argument: search_term' if search_term.blank?
19
10
  # API errors when search_term is blank, maybe it shouldn't
@@ -12,6 +12,15 @@ module FinApps
12
12
  super path
13
13
  end
14
14
 
15
+ def create(site_id, params)
16
+ raise MissingArgumentsError.new 'Missing argument: site_id.' if site_id.blank?
17
+ raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
18
+
19
+ path = "institutions/site/#{ERB::Util.url_encode(site_id)}/add"
20
+
21
+ super params, path
22
+ end
23
+
15
24
  def show(id)
16
25
  raise MissingArgumentsError.new 'Missing Argument: id.' if id.blank?
17
26
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
- VERSION = '2.0.23'
3
+ VERSION = '2.0.24'
4
4
  end
@@ -1,29 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::Institutions do
3
3
  let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
4
- describe '#create' do
5
- subject(:institutions) { FinApps::REST::Institutions.new(client) }
6
-
7
- context 'when missing site_id' do
8
- let(:create) { subject.create(nil, :params) }
9
- it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
10
- end
11
-
12
- context 'when missing params' do
13
- let(:create) { subject.create(:site_id, nil) }
14
- it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
15
- end
16
-
17
- context 'when valid site_id and params are provided' do
18
- let(:create) { subject.create('valid_site_id', :params) }
19
-
20
- it { expect { create }.not_to raise_error }
21
- it('performs a post and returns the response') { expect(create[0]).to respond_to(:user_institution) }
22
- it('returns no error messages') { expect(create[1]).to be_empty }
23
- end
24
-
25
- # No tests for invalid site_id/params because of API/Yodlee flow
26
- end
27
4
 
28
5
  describe '#list' do
29
6
  subject(:institutions) { FinApps::REST::Institutions.new(client) }
@@ -11,6 +11,30 @@ RSpec.describe FinApps::REST::UserInstitutions do
11
11
  end
12
12
  end
13
13
 
14
+ describe '#create' do
15
+ subject(:institutions) { FinApps::REST::UserInstitutions.new(client) }
16
+
17
+ context 'when missing site_id' do
18
+ let(:create) { subject.create(nil, :params) }
19
+ it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
20
+ end
21
+
22
+ context 'when missing params' do
23
+ let(:create) { subject.create(:site_id, nil) }
24
+ it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
25
+ end
26
+
27
+ context 'when valid site_id and params are provided' do
28
+ let(:create) { subject.create('valid_site_id', :params) }
29
+
30
+ it { expect { create }.not_to raise_error }
31
+ it('performs a post and returns the response') { expect(create[0]).to respond_to(:user_institution) }
32
+ it('returns no error messages') { expect(create[1]).to be_empty }
33
+ end
34
+
35
+ # No tests for invalid site_id/params because of API/Yodlee flow
36
+ end
37
+
14
38
  describe '#show' do
15
39
  context 'when missing id' do
16
40
  subject { FinApps::REST::UserInstitutions.new(client).show(nil) }
@@ -30,7 +30,6 @@ class FakeApi < Sinatra::Base
30
30
  get('/v2/institutions/site/valid_site_id/form') { json_response 200, 'institution_login_form.json' }
31
31
  get('/v2/institutions/site/invalid_site_id/form') { json_response 400, 'invalid_institution_id.json' }
32
32
  post('/v2/institutions/site/valid_site_id/add') { json_response 200, 'institution_add.json' }
33
- post('/v2/institutions/site/invalid_site_id/add') { json_response 400, 'invalid_institution_id.json' }
34
33
  get('/v2/institutions/search/:search_term') { json_response 200, 'institutions_search_list.json' }
35
34
 
36
35
  # user institutions
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: 2.0.23
4
+ version: 2.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday