finapps 3.0.7 → 4.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75c913496ab65c4be6d1610201787b5bd04420b0
4
- data.tar.gz: 0ecbc0fdf6347201e5d26a110290eada94f27740
3
+ metadata.gz: fd81b3035346891b3757d592f921f4482c947c16
4
+ data.tar.gz: c59b92dd1c5d56db66320d41ffa6cdf8e921e7df
5
5
  SHA512:
6
- metadata.gz: 864ae425008944d84d881c969a899bc4cd4785cf4a8b8e17f6a2cf90fa95b78357a45dc44d1b4404f00297bc358bdf119aac086d394835813aa468d734cdca30
7
- data.tar.gz: 302a5ac7381dab73a69aaba1cced1a0fbfb91d7035802aefb9df15866b4ac25dae467da0affceefc8f157fe28534afa38d324ed51ac5ce7bfd0dc13c342832a2
6
+ metadata.gz: b50a1a4950e425285a5f24f0d3f93092def1fe08c698a3bb3d296f4b99aa5abf6c9561425a7c4956830ba08b438c5c234f26ee3e0c5c5d776e9c34082ccbe1e4
7
+ data.tar.gz: 18c15c301db8a74bc703846a66e373a3e60cd2c6ec0abdbf486798e518f1820bd8cf6b40d0d9c4ad6eaefe96a4233c040a521768b1770e5e26e0c882ed50ca14
@@ -30,6 +30,7 @@ require 'finapps/rest/client'
30
30
  require 'finapps/rest/order_refreshes'
31
31
  require 'finapps/rest/statements'
32
32
  require 'finapps/rest/tenant_settings'
33
+ require 'finapps/rest/tenant_app_settings'
33
34
 
34
35
  require 'finapps/utils/query_builder'
35
36
  require 'finapps/version' unless defined?(FinApps::VERSION)
@@ -25,6 +25,7 @@ module FinApps
25
25
  consumers
26
26
  consumer_institution_refreshes
27
27
  tenant_settings
28
+ tenant_app_settings
28
29
  user_institutions
29
30
  user_institutions_forms
30
31
  user_institutions_statuses
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class TenantAppSettings < FinAppsCore::REST::Resources
6
+ END_POINT = 'settings/app'
7
+
8
+ def show
9
+ super nil, END_POINT
10
+ end
11
+
12
+ def update(params)
13
+ not_blank params, :params
14
+ super params, END_POINT
15
+ end
16
+ end
17
+ end
18
+ end
@@ -3,7 +3,7 @@
3
3
  module FinApps
4
4
  module REST
5
5
  class TenantSettings < FinAppsCore::REST::Resources
6
- END_POINT = 'settings/app'
6
+ END_POINT = 'settings/tenant'
7
7
 
8
8
  def show
9
9
  super nil, END_POINT
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '3.0.7'
4
+ VERSION = '4.0.1'
5
5
  end
@@ -102,6 +102,14 @@ RSpec.describe FinApps::REST::Client do
102
102
  it { expect(subject.statements).to be_an_instance_of(FinApps::REST::Statements) }
103
103
  end
104
104
 
105
+ describe '#tenant_settings' do
106
+ it { expect(subject.tenant_settings).to be_an_instance_of(FinApps::REST::TenantSettings) }
107
+ end
108
+
109
+ describe '#tenant_app_settings' do
110
+ it { expect(subject.tenant_app_settings).to be_an_instance_of(FinApps::REST::TenantAppSettings) }
111
+ end
112
+
105
113
  FinApps::REST::Client::RESOURCES.each do |method|
106
114
  it "memoizes the result of #{method}" do
107
115
  first = subject.send(method)
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+
5
+ RSpec.describe FinApps::REST::TenantAppSettings do
6
+ include SpecHelpers::Client
7
+ subject { FinApps::REST::TenantAppSettings.new(client) }
8
+
9
+ describe '#show' do
10
+ let(:show) { subject.show }
11
+
12
+ it { expect { show }.not_to raise_error }
13
+ it('performs a get and returns the response') do
14
+ expect(show[RESULTS]).to respond_to(:pdf_statement_months)
15
+ end
16
+ it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
17
+ end
18
+
19
+ describe '#update' do
20
+ let(:update) { subject.update(params) }
21
+
22
+ context 'when missing params' do
23
+ let(:params) { nil }
24
+ it { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
25
+ end
26
+
27
+ context 'when valid params are provided' do
28
+ let(:params) { {pdf_statement_months: 2} }
29
+
30
+ it { expect { update }.not_to raise_error }
31
+ it('performs put and returns no content') { expect(update[RESULTS]).to be_nil }
32
+ it('error_messages array is empty') { expect(update[ERROR_MESSAGES]).to be_empty }
33
+ end
34
+
35
+ context 'when invalid params are provided' do
36
+ let(:params) { {pdf_statement_months: nil} }
37
+
38
+ it { expect { update }.not_to raise_error }
39
+ it('results is nil') { expect(update[RESULTS]).to be_nil }
40
+ it('error_messages array is populated') { expect(update[ERROR_MESSAGES]).not_to be_empty }
41
+ end
42
+ end
43
+ end
@@ -11,7 +11,7 @@ RSpec.describe FinApps::REST::TenantSettings do
11
11
 
12
12
  it { expect { show }.not_to raise_error }
13
13
  it('performs a get and returns the response') do
14
- expect(show[RESULTS]).to respond_to(:product)
14
+ expect(show[RESULTS]).to respond_to(:iav_default_product)
15
15
  end
16
16
  it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
17
17
  end
@@ -25,7 +25,7 @@ RSpec.describe FinApps::REST::TenantSettings do
25
25
  end
26
26
 
27
27
  context 'when valid params are provided' do
28
- let(:params) { {product: 'valid'} }
28
+ let(:params) { {iav_default_product: 'valid'} }
29
29
 
30
30
  it { expect { update }.not_to raise_error }
31
31
  it('performs put and returns no content') { expect(update[RESULTS]).to be_nil }
@@ -33,7 +33,7 @@ RSpec.describe FinApps::REST::TenantSettings do
33
33
  end
34
34
 
35
35
  context 'when invalid params are provided' do
36
- let(:params) { {product: nil} }
36
+ let(:params) { {bad_params: true} }
37
37
 
38
38
  it { expect { update }.not_to raise_error }
39
39
  it('results is nil') { expect(update[RESULTS]).to be_nil }
@@ -15,11 +15,21 @@ class FakeApi < Sinatra::Base
15
15
  get('/v3/version') { 'Version => 2.1.29-.20161208.172810' }
16
16
 
17
17
  # tenants
18
- get('/v3/settings/app') { json_response 200, 'tenant_settings.json' }
18
+ get('/v3/settings/tenant') { json_response 200, 'tenant_settings.json' }
19
+ put('/v3/settings/tenant') do
20
+ request.body.rewind
21
+ request_payload = JSON.parse request.body.read
22
+ if request_payload['bad_params']
23
+ json_response 401, 'resource_not_found.json'
24
+ else
25
+ status 204
26
+ end
27
+ end
28
+ get('/v3/settings/app') { json_response 200, 'tenant_app_settings.json' }
19
29
  put('/v3/settings/app') do
20
30
  request.body.rewind
21
31
  request_payload = JSON.parse request.body.read
22
- if request_payload['product'] == 'valid'
32
+ if request_payload['pdf_statement_months']
23
33
  status 204
24
34
  else
25
35
  json_response 401, 'resource_not_found.json'
@@ -0,0 +1,3 @@
1
+ {
2
+ "pdf_statement_months": 3
3
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
- "product": "mav-o-en",
3
- "process_days": 90,
4
- "webhook": "",
5
- "pdf_statements": true,
6
- "statements": 3
2
+ "iav_default_product": "",
3
+ "iav_days_to_process": 90,
4
+ "iav_webhook_url": "",
5
+ "iav_requestor_company_name": "",
6
+ "iav_from_email": "noreply@financialapps.com"
7
7
  }
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: 3.0.7
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-19 00:00:00.000000000 Z
11
+ date: 2018-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -226,6 +226,7 @@ files:
226
226
  - lib/finapps/rest/products.rb
227
227
  - lib/finapps/rest/sessions.rb
228
228
  - lib/finapps/rest/statements.rb
229
+ - lib/finapps/rest/tenant_app_settings.rb
229
230
  - lib/finapps/rest/tenant_settings.rb
230
231
  - lib/finapps/rest/user_institutions.rb
231
232
  - lib/finapps/rest/user_institutions_forms.rb
@@ -252,6 +253,7 @@ files:
252
253
  - spec/rest/products_spec.rb
253
254
  - spec/rest/sessions_spec.rb
254
255
  - spec/rest/statements_spec.rb
256
+ - spec/rest/tenant_app_settings_spec.rb
255
257
  - spec/rest/tenant_settings_spec.rb
256
258
  - spec/rest/user_institutions_forms_spec.rb
257
259
  - spec/rest/user_institutions_spec.rb
@@ -284,6 +286,7 @@ files:
284
286
  - spec/support/fixtures/resource.json
285
287
  - spec/support/fixtures/resource_not_found.json
286
288
  - spec/support/fixtures/resources.json
289
+ - spec/support/fixtures/tenant_app_settings.json
287
290
  - spec/support/fixtures/tenant_settings.json
288
291
  - spec/support/fixtures/unauthorized.json
289
292
  - spec/support/fixtures/user.json
@@ -319,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
322
  version: '0'
320
323
  requirements: []
321
324
  rubyforge_project:
322
- rubygems_version: 2.6.13
325
+ rubygems_version: 2.6.8
323
326
  signing_key:
324
327
  specification_version: 4
325
328
  summary: FinApps REST API ruby client.
@@ -328,6 +331,7 @@ test_files:
328
331
  - spec/rest/consumer_institution_refreshes_spec.rb
329
332
  - spec/rest/order_assignments_spec.rb
330
333
  - spec/rest/tenant_settings_spec.rb
334
+ - spec/rest/tenant_app_settings_spec.rb
331
335
  - spec/rest/user_institutions_forms_spec.rb
332
336
  - spec/rest/client_spec.rb
333
337
  - spec/rest/version_spec.rb