finapps 2.0.29 → 2.0.30
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 +8 -0
 - data/lib/finapps/rest/order_statuses.rb +16 -0
 - data/lib/finapps/version.rb +1 -1
 - data/lib/finapps.rb +1 -0
 - data/spec/rest/client_spec.rb +12 -4
 - data/spec/rest/order_statuses_spec.rb +26 -0
 - data/spec/support/fake_api.rb +2 -0
 - data/spec/support/fixtures/order_status.json +3 -0
 - metadata +6 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e61830b719532ffe68a3133e861514c0080918ff
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 81d526e72235f792beca947b2647e702cf3d3e92
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 468d231c40ff6a9f766b2537d104b04483ae7ccbd199871cbb5f844136f01c2b13a26265aa53f8a5652b8c983febe25030f921a88fccd5b461a4a46b4a634b48
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2c26b47ada9b8cec80d034e67717ba28ed19a86c9cc6f536a74eaf5bdfc9a3aac3606b2f663b75b7b2bc82763077dc143d4f124e909e3d490d16a06d29a0d1f3
         
     | 
    
        data/lib/finapps/rest/client.rb
    CHANGED
    
    | 
         @@ -36,6 +36,14 @@ module FinApps 
     | 
|
| 
       36 
36 
     | 
    
         
             
                    @orders ||= FinApps::REST::Orders.new self
         
     | 
| 
       37 
37 
     | 
    
         
             
                  end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
      
 39 
     | 
    
         
            +
                  def order_reports
         
     | 
| 
      
 40 
     | 
    
         
            +
                    @order_reports ||= FinApps::REST::OrderReports.new self
         
     | 
| 
      
 41 
     | 
    
         
            +
                  end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  def order_statuses
         
     | 
| 
      
 44 
     | 
    
         
            +
                    @order_statuses ||= FinApps::REST::OrderStatuses.new self
         
     | 
| 
      
 45 
     | 
    
         
            +
                  end
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
       39 
47 
     | 
    
         
             
                  def institutions
         
     | 
| 
       40 
48 
     | 
    
         
             
                    @institutions ||= FinApps::REST::Institutions.new self
         
     | 
| 
       41 
49 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
            module FinApps
         
     | 
| 
      
 3 
     | 
    
         
            +
              module REST
         
     | 
| 
      
 4 
     | 
    
         
            +
                class OrderStatuses < FinApps::REST::Resources # :nodoc:
         
     | 
| 
      
 5 
     | 
    
         
            +
                  using ObjectExtensions
         
     | 
| 
      
 6 
     | 
    
         
            +
                  using StringExtensions
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  def show(id)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    raise MissingArgumentsError.new 'Missing argument: id.' if id.blank?
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                    path = "orders/#{ERB::Util.url_encode(id)}/status"
         
     | 
| 
      
 12 
     | 
    
         
            +
                    super nil, path
         
     | 
| 
      
 13 
     | 
    
         
            +
                  end
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/finapps/version.rb
    CHANGED
    
    
    
        data/lib/finapps.rb
    CHANGED
    
    | 
         @@ -34,6 +34,7 @@ require 'finapps/rest/user_institutions_statuses' 
     | 
|
| 
       34 
34 
     | 
    
         
             
            require 'finapps/rest/user_institutions'
         
     | 
| 
       35 
35 
     | 
    
         
             
            require 'finapps/rest/user_institutions_forms'
         
     | 
| 
       36 
36 
     | 
    
         
             
            require 'finapps/rest/order_reports'
         
     | 
| 
      
 37 
     | 
    
         
            +
            require 'finapps/rest/order_statuses'
         
     | 
| 
       37 
38 
     | 
    
         | 
| 
       38 
39 
     | 
    
         
             
            require 'finapps/rest/configuration'
         
     | 
| 
       39 
40 
     | 
    
         
             
            require 'finapps/rest/credentials'
         
     | 
    
        data/spec/rest/client_spec.rb
    CHANGED
    
    | 
         @@ -13,8 +13,8 @@ RSpec.describe FinApps::REST::Client do 
     | 
|
| 
       13 
13 
     | 
    
         
             
              context 'an instance of Client' do
         
     | 
| 
       14 
14 
     | 
    
         
             
                subject { FinApps::REST::Client.new(:company_identifier, :company_token) }
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                %i(users sessions orders order_tokens institutions institutions_forms 
     | 
| 
       17 
     | 
    
         
            -
                   user_institutions_forms).each do |method|
         
     | 
| 
      
 16 
     | 
    
         
            +
                %i(users sessions orders order_tokens order_reports order_statuses institutions institutions_forms
         
     | 
| 
      
 17 
     | 
    
         
            +
                   user_institutions_statuses user_institutions user_institutions_forms).each do |method|
         
     | 
| 
       18 
18 
     | 
    
         
             
                  it "responds to #{method}" do
         
     | 
| 
       19 
19 
     | 
    
         
             
                    expect(subject).to respond_to(method)
         
     | 
| 
       20 
20 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -28,6 +28,14 @@ RSpec.describe FinApps::REST::Client do 
     | 
|
| 
       28 
28 
     | 
    
         
             
                  it { expect(subject.sessions).to be_an_instance_of(FinApps::REST::Sessions) }
         
     | 
| 
       29 
29 
     | 
    
         
             
                end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
      
 31 
     | 
    
         
            +
                describe '#order_statuses' do
         
     | 
| 
      
 32 
     | 
    
         
            +
                  it { expect(subject.order_statuses).to be_an_instance_of(FinApps::REST::OrderStatuses) }
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                describe '#order_reports' do
         
     | 
| 
      
 36 
     | 
    
         
            +
                  it { expect(subject.order_reports).to be_an_instance_of(FinApps::REST::OrderReports) }
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
       31 
39 
     | 
    
         
             
                describe '#order_tokens' do
         
     | 
| 
       32 
40 
     | 
    
         
             
                  it { expect(subject.order_tokens).to be_an_instance_of(FinApps::REST::OrderTokens) }
         
     | 
| 
       33 
41 
     | 
    
         
             
                end
         
     | 
| 
         @@ -59,8 +67,8 @@ RSpec.describe FinApps::REST::Client do 
     | 
|
| 
       59 
67 
     | 
    
         
             
                # [:users, :institutions, :user_institutions, :transactions, :categories,
         
     | 
| 
       60 
68 
     | 
    
         
             
                # :budget_models, :budget_calculation, :budgets, :cashflows,
         
     | 
| 
       61 
69 
     | 
    
         
             
                # :alert, :alert_definition, :alert_preferences, :alert_settings, :rule_sets]
         
     | 
| 
       62 
     | 
    
         
            -
                %i(users sessions orders order_tokens institutions institutions_forms 
     | 
| 
       63 
     | 
    
         
            -
                   user_institutions_forms).each do |method|
         
     | 
| 
      
 70 
     | 
    
         
            +
                %i(users sessions orders order_tokens order_reports order_statuses institutions institutions_forms
         
     | 
| 
      
 71 
     | 
    
         
            +
                   user_institutions_statuses user_institutions user_institutions_forms).each do |method|
         
     | 
| 
       64 
72 
     | 
    
         
             
                  it "memoizes the result of #{method}" do
         
     | 
| 
       65 
73 
     | 
    
         
             
                    first = subject.send(method)
         
     | 
| 
       66 
74 
     | 
    
         
             
                    second = subject.send(method)
         
     | 
| 
         @@ -0,0 +1,26 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
            RSpec.describe FinApps::REST::OrderStatuses do
         
     | 
| 
      
 3 
     | 
    
         
            +
              let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
         
     | 
| 
      
 4 
     | 
    
         
            +
              describe '#show' do
         
     | 
| 
      
 5 
     | 
    
         
            +
                context 'when missing id' do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  subject { FinApps::REST::OrderStatuses.new(client).show(nil) }
         
     | 
| 
      
 7 
     | 
    
         
            +
                  it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                context 'when valid id is provided' do
         
     | 
| 
      
 11 
     | 
    
         
            +
                  subject { FinApps::REST::OrderStatuses.new(client).show(:valid_id) }
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  it { expect { subject }.not_to raise_error }
         
     | 
| 
      
 14 
     | 
    
         
            +
                  it('performs a get and returns the response') { expect(subject[0]).to respond_to(:status) }
         
     | 
| 
      
 15 
     | 
    
         
            +
                  it('returns no error messages') { expect(subject[1]).to be_empty }
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                context 'when invalid id is provided' do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  subject { FinApps::REST::OrderStatuses.new(client).show(:invalid_id) }
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                  it { expect { subject }.not_to raise_error }
         
     | 
| 
      
 22 
     | 
    
         
            +
                  it('results is nil') { expect(subject[0]).to be_nil }
         
     | 
| 
      
 23 
     | 
    
         
            +
                  it('error messages array is populated') { expect(subject[1].first.downcase).to eq('resource not found') }
         
     | 
| 
      
 24 
     | 
    
         
            +
                end
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/support/fake_api.rb
    CHANGED
    
    | 
         @@ -17,6 +17,8 @@ class FakeApi < Sinatra::Base 
     | 
|
| 
       17 
17 
     | 
    
         
             
              get('/v2/list/orders/:page/:requested/:sort/:asc') { json_response 200, 'orders.json' }
         
     | 
| 
       18 
18 
     | 
    
         
             
              get('/v2/orders/valid_id/report.:format') { json_response 200, 'order_report.json' }
         
     | 
| 
       19 
19 
     | 
    
         
             
              get('/v2/orders/invalid_id/report.:format') { json_response 404, 'resource_not_found.json' }
         
     | 
| 
      
 20 
     | 
    
         
            +
              get('/v2/orders/valid_id/status') { json_response 200, 'order_status.json' }
         
     | 
| 
      
 21 
     | 
    
         
            +
              get('/v2/orders/invalid_id/status') { json_response 404, 'resource_not_found.json' }
         
     | 
| 
       20 
22 
     | 
    
         
             
              put('/v2/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
         
     | 
| 
       21 
23 
     | 
    
         
             
              put('/v2/orders/valid_id') do
         
     | 
| 
       22 
24 
     | 
    
         
             
                request.body.rewind
         
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.30
         
     | 
| 
       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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-10-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: faraday
         
     | 
| 
         @@ -267,6 +267,7 @@ files: 
     | 
|
| 
       267 
267 
     | 
    
         
             
            - lib/finapps/rest/institutions.rb
         
     | 
| 
       268 
268 
     | 
    
         
             
            - lib/finapps/rest/institutions_forms.rb
         
     | 
| 
       269 
269 
     | 
    
         
             
            - lib/finapps/rest/order_reports.rb
         
     | 
| 
      
 270 
     | 
    
         
            +
            - lib/finapps/rest/order_statuses.rb
         
     | 
| 
       270 
271 
     | 
    
         
             
            - lib/finapps/rest/order_tokens.rb
         
     | 
| 
       271 
272 
     | 
    
         
             
            - lib/finapps/rest/orders.rb
         
     | 
| 
       272 
273 
     | 
    
         
             
            - lib/finapps/rest/resources.rb
         
     | 
| 
         @@ -292,6 +293,7 @@ files: 
     | 
|
| 
       292 
293 
     | 
    
         
             
            - spec/rest/institutions_forms_spec.rb
         
     | 
| 
       293 
294 
     | 
    
         
             
            - spec/rest/institutions_spec.rb
         
     | 
| 
       294 
295 
     | 
    
         
             
            - spec/rest/order_reports_spec.rb
         
     | 
| 
      
 296 
     | 
    
         
            +
            - spec/rest/order_statuses_spec.rb
         
     | 
| 
       295 
297 
     | 
    
         
             
            - spec/rest/order_tokens_spec.rb
         
     | 
| 
       296 
298 
     | 
    
         
             
            - spec/rest/orders_spec.rb
         
     | 
| 
       297 
299 
     | 
    
         
             
            - spec/rest/resources_spec.rb
         
     | 
| 
         @@ -312,6 +314,7 @@ files: 
     | 
|
| 
       312 
314 
     | 
    
         
             
            - spec/support/fixtures/invalid_user_id.json
         
     | 
| 
       313 
315 
     | 
    
         
             
            - spec/support/fixtures/invalid_user_institution_id.json
         
     | 
| 
       314 
316 
     | 
    
         
             
            - spec/support/fixtures/order_report.json
         
     | 
| 
      
 317 
     | 
    
         
            +
            - spec/support/fixtures/order_status.json
         
     | 
| 
       315 
318 
     | 
    
         
             
            - spec/support/fixtures/order_token.json
         
     | 
| 
       316 
319 
     | 
    
         
             
            - spec/support/fixtures/orders.json
         
     | 
| 
       317 
320 
     | 
    
         
             
            - spec/support/fixtures/relevance_ruleset_names.json
         
     | 
| 
         @@ -378,6 +381,7 @@ test_files: 
     | 
|
| 
       378 
381 
     | 
    
         
             
            - spec/rest/user_institutions_spec.rb
         
     | 
| 
       379 
382 
     | 
    
         
             
            - spec/rest/client_spec.rb
         
     | 
| 
       380 
383 
     | 
    
         
             
            - spec/rest/orders_spec.rb
         
     | 
| 
      
 384 
     | 
    
         
            +
            - spec/rest/order_statuses_spec.rb
         
     | 
| 
       381 
385 
     | 
    
         
             
            - spec/rest/configuration_spec.rb
         
     | 
| 
       382 
386 
     | 
    
         
             
            - spec/rest/resources_spec.rb
         
     | 
| 
       383 
387 
     | 
    
         
             
            - spec/rest/institutions_forms_spec.rb
         
     |