finapps 3.0.6 → 3.0.7
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 +4 -4
 - data/lib/finapps/rest/client.rb +1 -0
 - data/lib/finapps/rest/tenant_settings.rb +18 -0
 - data/lib/finapps/version.rb +1 -1
 - data/lib/finapps.rb +1 -0
 - data/spec/rest/tenant_settings_spec.rb +43 -0
 - data/spec/support/fake_api.rb +12 -0
 - data/spec/support/fixtures/tenant_settings.json +7 -0
 - metadata +24 -20
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 75c913496ab65c4be6d1610201787b5bd04420b0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0ecbc0fdf6347201e5d26a110290eada94f27740
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 864ae425008944d84d881c969a899bc4cd4785cf4a8b8e17f6a2cf90fa95b78357a45dc44d1b4404f00297bc358bdf119aac086d394835813aa468d734cdca30
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 302a5ac7381dab73a69aaba1cced1a0fbfb91d7035802aefb9df15866b4ac25dae467da0affceefc8f157fe28534afa38d324ed51ac5ce7bfd0dc13c342832a2
         
     | 
    
        data/lib/finapps/rest/client.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module FinApps
         
     | 
| 
      
 4 
     | 
    
         
            +
              module REST
         
     | 
| 
      
 5 
     | 
    
         
            +
                class TenantSettings < 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
         
     | 
    
        data/lib/finapps/version.rb
    CHANGED
    
    
    
        data/lib/finapps.rb
    CHANGED
    
    | 
         @@ -29,6 +29,7 @@ require 'finapps/rest/order_assignments' 
     | 
|
| 
       29 
29 
     | 
    
         
             
            require 'finapps/rest/client'
         
     | 
| 
       30 
30 
     | 
    
         
             
            require 'finapps/rest/order_refreshes'
         
     | 
| 
       31 
31 
     | 
    
         
             
            require 'finapps/rest/statements'
         
     | 
| 
      
 32 
     | 
    
         
            +
            require 'finapps/rest/tenant_settings'
         
     | 
| 
       32 
33 
     | 
    
         | 
| 
       33 
34 
     | 
    
         
             
            require 'finapps/utils/query_builder'
         
     | 
| 
       34 
35 
     | 
    
         
             
            require 'finapps/version' unless defined?(FinApps::VERSION)
         
     | 
| 
         @@ -0,0 +1,43 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'spec_helpers/client'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            RSpec.describe FinApps::REST::TenantSettings do
         
     | 
| 
      
 6 
     | 
    
         
            +
              include SpecHelpers::Client
         
     | 
| 
      
 7 
     | 
    
         
            +
              subject { FinApps::REST::TenantSettings.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(:product)
         
     | 
| 
      
 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) { {product: 'valid'} }
         
     | 
| 
      
 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) { {product: 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
         
     | 
    
        data/spec/support/fake_api.rb
    CHANGED
    
    | 
         @@ -14,6 +14,18 @@ class FakeApi < Sinatra::Base 
     | 
|
| 
       14 
14 
     | 
    
         
             
              # version
         
     | 
| 
       15 
15 
     | 
    
         
             
              get('/v3/version') { 'Version => 2.1.29-.20161208.172810' }
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
      
 17 
     | 
    
         
            +
              # tenants
         
     | 
| 
      
 18 
     | 
    
         
            +
              get('/v3/settings/app') { json_response 200, 'tenant_settings.json' }
         
     | 
| 
      
 19 
     | 
    
         
            +
              put('/v3/settings/app') do
         
     | 
| 
      
 20 
     | 
    
         
            +
                request.body.rewind
         
     | 
| 
      
 21 
     | 
    
         
            +
                request_payload = JSON.parse request.body.read
         
     | 
| 
      
 22 
     | 
    
         
            +
                if request_payload['product'] == 'valid'
         
     | 
| 
      
 23 
     | 
    
         
            +
                  status 204
         
     | 
| 
      
 24 
     | 
    
         
            +
                else
         
     | 
| 
      
 25 
     | 
    
         
            +
                  json_response 401, 'resource_not_found.json'
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       17 
29 
     | 
    
         
             
              # orders
         
     | 
| 
       18 
30 
     | 
    
         
             
              post('/v3/orders/valid_token') { json_response 200, 'order_token.json' }
         
     | 
| 
       19 
31 
     | 
    
         
             
              post('/v3/orders/invalid_token') { json_response 404, 'resource_not_found.json' }
         
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.0.7
         
     | 
| 
       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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-06-19 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_settings.rb
         
     | 
| 
       229 
230 
     | 
    
         
             
            - lib/finapps/rest/user_institutions.rb
         
     | 
| 
       230 
231 
     | 
    
         
             
            - lib/finapps/rest/user_institutions_forms.rb
         
     | 
| 
       231 
232 
     | 
    
         
             
            - lib/finapps/rest/user_institutions_statuses.rb
         
     | 
| 
         @@ -251,6 +252,7 @@ files: 
     | 
|
| 
       251 
252 
     | 
    
         
             
            - spec/rest/products_spec.rb
         
     | 
| 
       252 
253 
     | 
    
         
             
            - spec/rest/sessions_spec.rb
         
     | 
| 
       253 
254 
     | 
    
         
             
            - spec/rest/statements_spec.rb
         
     | 
| 
      
 255 
     | 
    
         
            +
            - spec/rest/tenant_settings_spec.rb
         
     | 
| 
       254 
256 
     | 
    
         
             
            - spec/rest/user_institutions_forms_spec.rb
         
     | 
| 
       255 
257 
     | 
    
         
             
            - spec/rest/user_institutions_spec.rb
         
     | 
| 
       256 
258 
     | 
    
         
             
            - spec/rest/user_institutions_statuses_spec.rb
         
     | 
| 
         @@ -282,6 +284,7 @@ files: 
     | 
|
| 
       282 
284 
     | 
    
         
             
            - spec/support/fixtures/resource.json
         
     | 
| 
       283 
285 
     | 
    
         
             
            - spec/support/fixtures/resource_not_found.json
         
     | 
| 
       284 
286 
     | 
    
         
             
            - spec/support/fixtures/resources.json
         
     | 
| 
      
 287 
     | 
    
         
            +
            - spec/support/fixtures/tenant_settings.json
         
     | 
| 
       285 
288 
     | 
    
         
             
            - spec/support/fixtures/unauthorized.json
         
     | 
| 
       286 
289 
     | 
    
         
             
            - spec/support/fixtures/user.json
         
     | 
| 
       287 
290 
     | 
    
         
             
            - spec/support/fixtures/user_institution_refresh.json
         
     | 
| 
         @@ -321,29 +324,30 @@ signing_key: 
     | 
|
| 
       321 
324 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       322 
325 
     | 
    
         
             
            summary: FinApps REST API ruby client.
         
     | 
| 
       323 
326 
     | 
    
         
             
            test_files:
         
     | 
| 
       324 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       325 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       326 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       327 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
      
 327 
     | 
    
         
            +
            - spec/rest/institutions_spec.rb
         
     | 
| 
      
 328 
     | 
    
         
            +
            - spec/rest/consumer_institution_refreshes_spec.rb
         
     | 
| 
      
 329 
     | 
    
         
            +
            - spec/rest/order_assignments_spec.rb
         
     | 
| 
      
 330 
     | 
    
         
            +
            - spec/rest/tenant_settings_spec.rb
         
     | 
| 
       328 
331 
     | 
    
         
             
            - spec/rest/user_institutions_forms_spec.rb
         
     | 
| 
       329 
     | 
    
         
            -
            - spec/rest/consumers_spec.rb
         
     | 
| 
       330 
     | 
    
         
            -
            - spec/rest/orders_spec.rb
         
     | 
| 
       331 
     | 
    
         
            -
            - spec/rest/order_tokens_spec.rb
         
     | 
| 
       332 
     | 
    
         
            -
            - spec/rest/institutions_forms_spec.rb
         
     | 
| 
       333 
     | 
    
         
            -
            - spec/rest/operators_spec.rb
         
     | 
| 
       334 
     | 
    
         
            -
            - spec/rest/user_institutions_statuses_spec.rb
         
     | 
| 
       335 
332 
     | 
    
         
             
            - spec/rest/client_spec.rb
         
     | 
| 
       336 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       337 
     | 
    
         
            -
            - spec/rest/consumer_institution_refreshes_spec.rb
         
     | 
| 
      
 333 
     | 
    
         
            +
            - spec/rest/version_spec.rb
         
     | 
| 
       338 
334 
     | 
    
         
             
            - spec/rest/password_resets_spec.rb
         
     | 
| 
       339 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       340 
     | 
    
         
            -
            - spec/rest/institutions_spec.rb
         
     | 
| 
      
 335 
     | 
    
         
            +
            - spec/rest/operators_spec.rb
         
     | 
| 
       341 
336 
     | 
    
         
             
            - spec/rest/order_statuses_spec.rb
         
     | 
| 
      
 337 
     | 
    
         
            +
            - spec/rest/order_reports_spec.rb
         
     | 
| 
      
 338 
     | 
    
         
            +
            - spec/rest/consumers_spec.rb
         
     | 
| 
      
 339 
     | 
    
         
            +
            - spec/rest/sessions_spec.rb
         
     | 
| 
      
 340 
     | 
    
         
            +
            - spec/rest/user_institutions_statuses_spec.rb
         
     | 
| 
      
 341 
     | 
    
         
            +
            - spec/rest/orders_spec.rb
         
     | 
| 
      
 342 
     | 
    
         
            +
            - spec/rest/operators_password_resets_spec.rb
         
     | 
| 
      
 343 
     | 
    
         
            +
            - spec/rest/institutions_forms_spec.rb
         
     | 
| 
       342 
344 
     | 
    
         
             
            - spec/rest/order_refreshes_spec.rb
         
     | 
| 
       343 
345 
     | 
    
         
             
            - spec/rest/order_notifications_spec.rb
         
     | 
| 
       344 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       345 
     | 
    
         
            -
            - spec/rest/ 
     | 
| 
       346 
     | 
    
         
            -
            - spec/ 
     | 
| 
      
 346 
     | 
    
         
            +
            - spec/rest/statements_spec.rb
         
     | 
| 
      
 347 
     | 
    
         
            +
            - spec/rest/order_tokens_spec.rb
         
     | 
| 
      
 348 
     | 
    
         
            +
            - spec/rest/user_institutions_spec.rb
         
     | 
| 
      
 349 
     | 
    
         
            +
            - spec/rest/products_spec.rb
         
     | 
| 
       347 
350 
     | 
    
         
             
            - spec/utils/query_builder_spec.rb
         
     | 
| 
       348 
     | 
    
         
            -
            - spec/ 
     | 
| 
      
 351 
     | 
    
         
            +
            - spec/support/fake_api.rb
         
     | 
| 
       349 
352 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
      
 353 
     | 
    
         
            +
            - spec/spec_helpers/client.rb
         
     |