finapps 4.0.5 → 4.0.6

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
- SHA1:
3
- metadata.gz: a05f192b629e85e689d080fac49dc2b6a117a823
4
- data.tar.gz: d19ae194b2dbb8d7fd518b1cfec0e71a5bce6088
2
+ SHA256:
3
+ metadata.gz: e1e6ff1a8379127a67c120835e11aa5d02b4a250341583e6bb31d340b9eb6527
4
+ data.tar.gz: a0599c41a38248aaa2180a005cc6020666280e1b92137744d3143691fa39c1e9
5
5
  SHA512:
6
- metadata.gz: 94eeac31a8838ab0c8a43aff2f2f5514dae8684a3f1b18ddde480500205010eb41746fdd8ea0cc7ff30096fcb8f8bfa86a86d9fa1fd9e48cacd7e5de60717b5d
7
- data.tar.gz: 431604c2f7dc6ba3b96c004000176dcf959ed1cb4147aacbe8c9d6b9a3c6954deddfd6540a9d814654740b0f4e8666b02ce6a6500b1b32187069f96e0960e061
6
+ metadata.gz: a728f579cc44d56586cb0fd05e4949c38305791687dd6e9e231021477809cab9f5896f2e67974c82a6460f6d9f66b7a6b5ab5c235980a0a0c8fb4a6c0828ea95
7
+ data.tar.gz: 6a4721575df2270662974814db05af130ed69038ce6acfcccbd9841b47bbbba787d05b5d15ec603277e3adf81614a8b89939e8e4a7388aa772dcfe52e5443458
data/finapps.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 4.0', '>= 4.0.4'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 4.0', '>= 4.0.5'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16.6'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
@@ -3,15 +3,20 @@
3
3
  module FinApps
4
4
  module REST
5
5
  class Sessions < FinAppsCore::REST::Resources # :nodoc:
6
+ CONSUMER_LOGIN = 'login'
6
7
  LOGOUT = 'logout'
7
8
 
8
9
  def create(params, path = nil)
9
10
  return super nil, path if path == LOGOUT
10
11
  raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params
11
12
 
12
- path ||= 'login'
13
+ path ||= CONSUMER_LOGIN
13
14
 
14
- super params, path
15
+ begin
16
+ super params, path
17
+ rescue FinAppsCore::ApiUnauthenticatedError
18
+ return [nil, ["Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"]]
19
+ end
15
20
  end
16
21
 
17
22
  def destroy
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '4.0.5'
4
+ VERSION = '4.0.7'
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'spec_helpers/client'
4
+
3
5
  RSpec.describe FinApps::REST::OrderTokens, 'initialized with valid FinApps::Client object' do
4
6
  include SpecHelpers::Client
5
7
 
@@ -28,7 +28,7 @@ RSpec.describe FinApps::REST::Sessions, 'initialized with valid FinApps::Client
28
28
 
29
29
  it { expect { create }.not_to raise_error }
30
30
  it('results is nil') { expect(results).to be_nil }
31
- error_message = 'Invalid User Identifier or Credentials'
31
+ error_message = 'Invalid Consumer Identifier or Credentials'
32
32
  it('error_messages are populated') { expect(error_messages.first).to eq(error_message) }
33
33
  end
34
34
 
data/spec/spec_helper.rb CHANGED
@@ -37,7 +37,7 @@ RSpec.configure do |config|
37
37
  end
38
38
 
39
39
  VALID_CREDENTIALS = { identifier: '49fb918d-7e71-44dd-7378-58f19606df2a',
40
- token: 'hohoho=' }.freeze
40
+ token: 'hohoho=' }.freeze
41
41
 
42
42
  RESULTS = 0
43
43
  ERROR_MESSAGES = 1
@@ -20,7 +20,7 @@ class FakeApi < Sinatra::Base
20
20
  request.body.rewind
21
21
  request_payload = JSON.parse request.body.read
22
22
  if request_payload['bad_params']
23
- json_response 401, 'resource_not_found.json'
23
+ json_response 404, 'resource_not_found.json'
24
24
  else
25
25
  status 204
26
26
  end
@@ -32,7 +32,7 @@ class FakeApi < Sinatra::Base
32
32
  if request_payload['pdf_statement_months']
33
33
  status 204
34
34
  else
35
- json_response 401, 'resource_not_found.json'
35
+ json_response 404, 'resource_not_found.json'
36
36
  end
37
37
  end
38
38
 
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: 4.0.5
4
+ version: 4.0.6
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-10-15 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 4.0.4
22
+ version: 4.0.5
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 4.0.4
32
+ version: 4.0.5
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -348,36 +348,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
348
  version: '0'
349
349
  requirements: []
350
350
  rubyforge_project:
351
- rubygems_version: 2.6.13
351
+ rubygems_version: 2.7.6
352
352
  signing_key:
353
353
  specification_version: 4
354
354
  summary: FinApps REST API ruby client.
355
355
  test_files:
356
- - spec/rest/operators_password_resets_spec.rb
357
- - spec/rest/products_spec.rb
358
- - spec/rest/statements_spec.rb
359
- - spec/rest/version_spec.rb
360
- - spec/rest/user_institutions_forms_spec.rb
361
- - spec/rest/consumers_spec.rb
362
- - spec/rest/orders_spec.rb
363
- - spec/rest/order_tokens_spec.rb
364
- - spec/rest/institutions_forms_spec.rb
356
+ - spec/rest/institutions_spec.rb
357
+ - spec/rest/consumer_institution_refreshes_spec.rb
358
+ - spec/rest/order_assignments_spec.rb
359
+ - spec/rest/tenant_settings_spec.rb
365
360
  - spec/rest/tenant_app_settings_spec.rb
366
- - spec/rest/operators_spec.rb
367
- - spec/rest/user_institutions_statuses_spec.rb
361
+ - spec/rest/user_institutions_forms_spec.rb
368
362
  - spec/rest/client_spec.rb
369
- - spec/rest/tenant_settings_spec.rb
370
- - spec/rest/user_institutions_spec.rb
371
- - spec/rest/consumer_institution_refreshes_spec.rb
363
+ - spec/rest/version_spec.rb
372
364
  - spec/rest/password_resets_spec.rb
373
- - spec/rest/order_reports_spec.rb
374
- - spec/rest/institutions_spec.rb
365
+ - spec/rest/operators_spec.rb
375
366
  - spec/rest/order_statuses_spec.rb
367
+ - spec/rest/order_reports_spec.rb
368
+ - spec/rest/consumers_spec.rb
369
+ - spec/rest/sessions_spec.rb
370
+ - spec/rest/user_institutions_statuses_spec.rb
371
+ - spec/rest/orders_spec.rb
372
+ - spec/rest/operators_password_resets_spec.rb
373
+ - spec/rest/institutions_forms_spec.rb
376
374
  - spec/rest/order_refreshes_spec.rb
377
375
  - spec/rest/order_notifications_spec.rb
378
- - spec/rest/order_assignments_spec.rb
379
- - spec/rest/sessions_spec.rb
380
- - spec/support/fake_api.rb
376
+ - spec/rest/statements_spec.rb
377
+ - spec/rest/order_tokens_spec.rb
378
+ - spec/rest/user_institutions_spec.rb
379
+ - spec/rest/products_spec.rb
381
380
  - spec/utils/query_builder_spec.rb
382
- - spec/spec_helpers/client.rb
381
+ - spec/support/fake_api.rb
383
382
  - spec/spec_helper.rb
383
+ - spec/spec_helpers/client.rb