finapps 6.10.1 → 6.10.2

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
  SHA256:
3
- metadata.gz: b42aeaed6c32c359360c5f40a432723036e7118029003cd6b0d0e2fccad644fd
4
- data.tar.gz: 720c838e5da2710309dc6be29e640ba6238c101244145a4eb20b06d765c4387b
3
+ metadata.gz: d55e0e0252d632b2a68bdf279f4a4e33181bcf1d8be6ca5513399e0cb34fd08b
4
+ data.tar.gz: 311a8cbe50f22112ddbf0360567ad10ef36967d4247d973b6275c2054ba67a82
5
5
  SHA512:
6
- metadata.gz: 6b6a365b8057aebefb8431f93e660b133deda0ae94829aa2fdc98d4f59001c9b1cd803af75b44de83bb5c574d940dacb25e13b1e40ff93b2f76893a7bf3001e6
7
- data.tar.gz: 7f09473a81677c621c2ebc86e15e346a4d3c5418e3e845c2ac16cf8237c247ccb5aa2b70e46744b1bad3d6f4bb5784be1e9bcca7ecb806dc3fe663e6f050e60d
6
+ metadata.gz: 2e24379649d976509c222127152ddf7d98cd5fcbcffc0a3ed5700295b418685c21bf2a51e7e91804c8ff066fa1e1e0da155762710dfbbb12061bc23d1458fa68
7
+ data.tar.gz: df2ab06514a0a5bc3fac7b0e880e370d321fe2261f522945dc00f0ab656d289b91609b45274c4a743e0b795c8139e236e5c54311dc4e0e96cf7d3985dd1ef414
@@ -67,10 +67,11 @@ module FinApps
67
67
  end
68
68
 
69
69
  def term_array(term)
70
- [
71
- {email: term},
72
- {last_name: term}
73
- ]
70
+ if term.include?('@')
71
+ [{email: term}]
72
+ else
73
+ [{last_name: term}]
74
+ end
74
75
  end
75
76
 
76
77
  def role_filter(role)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.10.1'
4
+ VERSION = '6.10.2'
5
5
  end
@@ -7,6 +7,26 @@ RSpec.describe FinApps::REST::Locations do
7
7
 
8
8
  let(:id) { :id }
9
9
 
10
+ params = {name: 'Quick Mart Non-Urgent Care', state: {code: 'MD'}}
11
+
12
+ RSpec::Matchers.define :have_keys do |*keys|
13
+ match {|actual| keys.all? {|key| actual.key? key } }
14
+ end
15
+
16
+ RSpec.shared_examples 'a request to a not found resource' do
17
+ it_behaves_like 'a failed request'
18
+ it('returns a 404 error') do
19
+ expect(subject[ERROR_MESSAGES].first)
20
+ .to(eq('the server responded with status 404'))
21
+ end
22
+ end
23
+
24
+ RSpec.shared_examples 'a successful API request returning an empty body' do
25
+ it_behaves_like 'an API request'
26
+ it_behaves_like 'a successful request'
27
+ it { expect(subject[RESULTS]).to be_nil }
28
+ end
29
+
10
30
  describe '#list' do
11
31
  subject(:list) { described_class.new(client).list filter }
12
32
 
@@ -14,9 +34,7 @@ RSpec.describe FinApps::REST::Locations do
14
34
 
15
35
  it_behaves_like 'an API request'
16
36
  it_behaves_like 'a successful request'
17
- it { expect(list[RESULTS]).to all(have_key(:id)) }
18
- it { expect(list[RESULTS]).to all(have_key(:name)) }
19
- it { expect(list[RESULTS]).to all(have_key(:state)) }
37
+ it { expect(list[RESULTS]).to all(have_keys(:id, :name, :state)) }
20
38
 
21
39
  context 'when the JMESPath filter is invalid' do
22
40
  let(:filter) { 'invalid' }
@@ -25,32 +43,14 @@ RSpec.describe FinApps::REST::Locations do
25
43
  end
26
44
  end
27
45
 
28
- describe '#create' do
29
- subject(:create) { described_class.new(client).create(params) }
30
-
31
- let(:params) { {name: 'Quick Mart Urgent Care', state: {code: 'MD'}} }
32
-
33
- it_behaves_like 'an API request'
34
- it_behaves_like 'a successful request'
35
- it { expect(create[RESULTS]).to be_nil }
36
- end
37
-
38
- RSpec.shared_examples 'a request to a not found resource' do
39
- it_behaves_like 'a failed request'
40
- it('returns a 404 error') do
41
- expect(subject[ERROR_MESSAGES].first)
42
- .to(eq('the server responded with status 404'))
43
- end
44
- end
45
-
46
46
  describe '#show' do
47
47
  subject(:show) { described_class.new(client).show(id) }
48
48
 
49
- it_behaves_like 'an API request'
50
- it_behaves_like 'a successful request'
51
- it { expect(show[RESULTS]).to have_key(:id) }
52
- it { expect(show[RESULTS]).to have_key(:name) }
53
- it { expect(show[RESULTS]).to have_key(:state) }
49
+ context 'when the location exists' do
50
+ it_behaves_like 'an API request'
51
+ it_behaves_like 'a successful request'
52
+ it { expect(show[RESULTS]).to have_keys(:id, :name, :state) }
53
+ end
54
54
 
55
55
  context 'when id does not match any location' do
56
56
  let(:id) { 'not_found' }
@@ -59,14 +59,18 @@ RSpec.describe FinApps::REST::Locations do
59
59
  end
60
60
  end
61
61
 
62
+ describe '#create' do
63
+ subject(:create) { described_class.new(client).create(params) }
64
+
65
+ it_behaves_like 'a successful API request returning an empty body'
66
+ end
67
+
62
68
  describe '#update' do
63
69
  subject(:update) { described_class.new(client).update(id, params) }
64
70
 
65
- let(:params) { {name: 'Quick Mart Non-Urgent Care', state: {code: 'MD'}} }
66
-
67
- it_behaves_like 'an API request'
68
- it_behaves_like 'a successful request'
69
- it { expect(update[RESULTS]).to be_nil }
71
+ context 'when the location exists' do
72
+ it_behaves_like 'a successful API request returning an empty body'
73
+ end
70
74
 
71
75
  context 'when id does not match any location' do
72
76
  let(:id) { 'not_found' }
@@ -78,9 +82,9 @@ RSpec.describe FinApps::REST::Locations do
78
82
  describe '#destroy' do
79
83
  subject(:destroy) { described_class.new(client).destroy(id) }
80
84
 
81
- it_behaves_like 'an API request'
82
- it_behaves_like 'a successful request'
83
- it { expect(destroy[RESULTS]).to be_nil }
85
+ context 'when the location exists' do
86
+ it_behaves_like 'a successful API request returning an empty body'
87
+ end
84
88
 
85
89
  context 'when id does not match any location' do
86
90
  let(:id) { 'not_found' }
@@ -25,12 +25,21 @@ RSpec.describe FinApps::REST::Operators do
25
25
  end
26
26
  end
27
27
 
28
- context 'with searchTerm' do
28
+ context 'with email searchTerm' do
29
+ let(:params) { {searchTerm: 'term@example.com'} }
30
+
31
+ it_behaves_like 'a filtereable GET index request', {
32
+ '$or': [
33
+ {email: 'term@example.com'}
34
+ ]
35
+ }
36
+ end
37
+
38
+ context 'with non email searchTerm' do
29
39
  let(:params) { {searchTerm: 'le term'} }
30
40
 
31
41
  it_behaves_like 'a filtereable GET index request', {
32
42
  '$or': [
33
- {email: 'le term'},
34
43
  {last_name: 'le term'}
35
44
  ]
36
45
  }
@@ -65,7 +74,7 @@ RSpec.describe FinApps::REST::Operators do
65
74
  it 'builds a full filter and query and sends the request' do
66
75
  list
67
76
 
68
- filter = {'$or': [{email: 't'}, {last_name: 't'}], role: {'$in': [2]}}
77
+ filter = {'$or': [{last_name: 't'}], role: {'$in': [2]}}
69
78
  expect(WebMock).to have_requested(:get, "#{versioned_api_path}/operators"\
70
79
  "?filter=#{ERB::Util.url_encode filter.to_json}"\
71
80
  '&page=2&requested=25&sort=date_created')
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if ENV['COVERAGE'] == 'true'
3
+ if ENV.fetch('COVERAGE', nil) == 'true'
4
4
  require 'simplecov'
5
5
  require 'simplecov-console'
6
6
 
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: 6.10.1
4
+ version: 6.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-13 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -483,65 +483,65 @@ signing_key:
483
483
  specification_version: 4
484
484
  summary: FinApps REST API ruby client.
485
485
  test_files:
486
- - spec/spec_helper.rb
487
- - spec/spec_helpers/api_request.rb
488
- - spec/spec_helpers/client.rb
489
- - spec/rest/query/screenings_spec.rb
486
+ - spec/support/documents_uploads_routes.rb
487
+ - spec/support/fake_api.rb
488
+ - spec/support/routes/query_screenings.rb
489
+ - spec/support/routes/locations.rb
490
+ - spec/support/routes/states.rb
491
+ - spec/support/routes/actors.rb
492
+ - spec/support/routes/screening_metadatas.rb
493
+ - spec/support/screenings_routes.rb
494
+ - spec/rest/order_assignments_spec.rb
490
495
  - spec/rest/query/base_spec.rb
491
- - spec/rest/portfolios_available_consumers_spec.rb
492
- - spec/rest/documents_orders_notifications_spec.rb
493
- - spec/rest/portfolios_alerts_spec.rb
494
- - spec/rest/version_spec.rb
496
+ - spec/rest/query/screenings_spec.rb
495
497
  - spec/rest/alert_occurrences_spec.rb
496
- - spec/rest/products_spec.rb
497
498
  - spec/rest/operator_change_password_email_spec.rb
498
499
  - spec/rest/consumers_spec.rb
499
- - spec/rest/screenings_spec.rb
500
- - spec/rest/order_notifications_spec.rb
501
- - spec/rest/tenant_app_settings_spec.rb
502
- - spec/rest/order_reports_spec.rb
503
500
  - spec/rest/documents_uploads_spec.rb
504
501
  - spec/rest/operators_spec.rb
505
502
  - spec/rest/portfolios_spec.rb
506
- - spec/rest/locations_spec.rb
507
- - spec/rest/client_spec.rb
503
+ - spec/rest/alert_definitions_spec.rb
504
+ - spec/rest/consumers_portfolios_spec.rb
505
+ - spec/rest/plaid/plaid_institution_logos_spec.rb
506
+ - spec/rest/plaid/plaid_consumer_institutions_spec.rb
507
+ - spec/rest/plaid/plaid_account_permissions_spec.rb
508
+ - spec/rest/plaid/plaid_accounts_spec.rb
509
+ - spec/rest/plaid/plaid_webhooks_spec.rb
508
510
  - spec/rest/actors_spec.rb
509
- - spec/rest/documents_orders_spec.rb
511
+ - spec/rest/client_spec.rb
512
+ - spec/rest/signed_documents_downloads_spec.rb
513
+ - spec/rest/tenant_app_settings_spec.rb
514
+ - spec/rest/operators_login_tokens_spec.rb
515
+ - spec/rest/order_tokens_spec.rb
510
516
  - spec/rest/consumer_login_tokens_spec.rb
517
+ - spec/rest/products_spec.rb
518
+ - spec/rest/password_resets_spec.rb
511
519
  - spec/rest/documents_upload_types_spec.rb
512
520
  - spec/rest/tenant_settings_spec.rb
513
- - spec/rest/screening_metadatas_spec.rb
514
- - spec/rest/order_tokens_spec.rb
515
- - spec/rest/order_refreshes_spec.rb
521
+ - spec/rest/order_reports_spec.rb
522
+ - spec/rest/locations_spec.rb
516
523
  - spec/rest/operators_password_resets_spec.rb
517
- - spec/rest/order_assignments_spec.rb
518
- - spec/rest/alert_definitions_spec.rb
519
- - spec/rest/signed_documents_downloads_spec.rb
520
- - spec/rest/operators_login_tokens_spec.rb
521
- - spec/rest/verix/verix_metadata_spec.rb
522
- - spec/rest/verix/verix_records_spec.rb
523
- - spec/rest/verix/verix_pdf_documents_spec.rb
524
- - spec/rest/verix/verix_documents_spec.rb
525
- - spec/rest/password_resets_spec.rb
526
- - spec/rest/plaid/plaid_webhooks_spec.rb
527
- - spec/rest/plaid/plaid_account_permissions_spec.rb
528
- - spec/rest/plaid/plaid_institution_logos_spec.rb
529
- - spec/rest/plaid/plaid_accounts_spec.rb
530
- - spec/rest/plaid/plaid_consumer_institutions_spec.rb
531
- - spec/rest/states_spec.rb
524
+ - spec/rest/sessions_spec.rb
525
+ - spec/rest/portfolios_alerts_spec.rb
532
526
  - spec/rest/esign_templates_spec.rb
527
+ - spec/rest/portfolios_available_consumers_spec.rb
528
+ - spec/rest/portfolio_reports_spec.rb
529
+ - spec/rest/version_spec.rb
530
+ - spec/rest/verix/verix_documents_spec.rb
531
+ - spec/rest/verix/verix_pdf_documents_spec.rb
532
+ - spec/rest/verix/verix_records_spec.rb
533
+ - spec/rest/verix/verix_metadata_spec.rb
533
534
  - spec/rest/portfolios_consumers_spec.rb
535
+ - spec/rest/screenings_spec.rb
536
+ - spec/rest/screening_metadatas_spec.rb
537
+ - spec/rest/states_spec.rb
538
+ - spec/rest/documents_orders_notifications_spec.rb
539
+ - spec/rest/order_refreshes_spec.rb
534
540
  - spec/rest/order_statuses_spec.rb
535
- - spec/rest/portfolio_reports_spec.rb
536
- - spec/rest/sessions_spec.rb
537
- - spec/rest/consumers_portfolios_spec.rb
538
541
  - spec/rest/orders_spec.rb
542
+ - spec/rest/documents_orders_spec.rb
543
+ - spec/rest/order_notifications_spec.rb
539
544
  - spec/utils/query_builder_spec.rb
540
- - spec/support/screenings_routes.rb
541
- - spec/support/documents_uploads_routes.rb
542
- - spec/support/routes/screening_metadatas.rb
543
- - spec/support/routes/query_screenings.rb
544
- - spec/support/routes/states.rb
545
- - spec/support/routes/actors.rb
546
- - spec/support/routes/locations.rb
547
- - spec/support/fake_api.rb
545
+ - spec/spec_helpers/client.rb
546
+ - spec/spec_helpers/api_request.rb
547
+ - spec/spec_helper.rb