finapps 6.4.0 → 6.4.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
  SHA256:
3
- metadata.gz: 8428ee4965080f78c083fc2e3d0de2fc66b59596bf5ea81bbbc17e2c11ad2b39
4
- data.tar.gz: 0656c926f0b3c70929fb6fbe1b69282d766c56c777aa32ed377218ceac9a6824
3
+ metadata.gz: 685415494dde868b2db873ce98d626c4ed45f4e96604b475c1db6fcd892abbeb
4
+ data.tar.gz: 0b4b6599766968bee2752b7d2e968c9d856a9f56f0ebfe1d33d411f3d57e6579
5
5
  SHA512:
6
- metadata.gz: 4163eda4a00e4df6c1a34cd76733d11c53fc4774899aabea933bbfe304e5acbd92ea714ccbbd974f8bd496278e501d7fd0d8591ad503480356e9ca75f98198ee
7
- data.tar.gz: 756edbc47cdb115e15efe6dc53be0aeea1610feb93470fed421105ce2a7a6b8fa59c04fc84c99c9c5d75a8914b21de5e68d69c29ff584ab810506f948daed233
6
+ metadata.gz: eab93c5894770567f201112caf3b93455c4d473aa20c8e466a9aafb0afdbe6a6dd556d55efa10db62af89f6b41d3b332c04b162b4f728c712ff0982c9843bd1b
7
+ data.tar.gz: c008d2a8dffc8be3e359c95bd7de30f07de6c26b12d2d7bfbb382553eaa108d5228e652fe56ce10ef7be9b91abaafe753fc4644c50ab928d06f86d7db3889370
@@ -115,7 +115,7 @@ module FinApps
115
115
  def progress_filter(progress)
116
116
  return {} unless progress
117
117
 
118
- {progress: progress}
118
+ {progress: progress.to_int}
119
119
  end
120
120
 
121
121
  def space?(string)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.4.0'
4
+ VERSION = '6.4.1'
5
5
  end
@@ -215,7 +215,7 @@ RSpec.describe FinApps::REST::DocumentsOrders do
215
215
  end
216
216
  end
217
217
 
218
- context 'with missing params' do
218
+ context 'with missing params' do
219
219
  let(:params) { nil }
220
220
 
221
221
  it_behaves_like 'a request that raises an error'
@@ -13,74 +13,75 @@ RSpec.describe FinApps::REST::Screenings do
13
13
  subject(:list) { described_class.new(client).list(params) }
14
14
 
15
15
  context 'with valid params' do
16
+ let(:params) { {} }
17
+
18
+ RSpec.shared_examples 'performs a GET request' do
19
+ it { expect(results).to have_key(:records) }
20
+ end
21
+
22
+ RSpec.shared_examples 'a correct query builder' do |filter|
23
+ it 'builds query and sends proper request' do
24
+ list
25
+ encoded_filter = ERB::Util.url_encode filter.to_json
26
+ url = "#{versioned_api_path}/screenings?filter=#{encoded_filter}"
27
+
28
+ expect(WebMock).to have_requested(:get, url)
29
+ end
30
+ end
31
+
16
32
  context 'without searchTerm' do
17
33
  let(:params) { {searchTerm: nil, page: 2} }
18
34
 
19
35
  it_behaves_like 'an API request'
20
36
  it_behaves_like 'a successful request'
21
- it 'performs a get and returns the response' do
22
- expect(results).to have_key(:records)
23
- end
24
-
37
+ it_behaves_like 'performs a GET request'
25
38
  it 'builds query and sends proper request' do
26
39
  list
27
40
  url = "#{versioned_api_path}/screenings?page=2"
41
+
28
42
  expect(WebMock).to have_requested(:get, url)
29
43
  end
30
44
  end
31
45
 
32
- # rubocop:disable RSpec/ExampleLength
33
46
  context 'with date range' do
34
47
  let(:params) { {fromDate: '08/01/2021', toDate: '09/01/2021'} }
35
48
 
36
49
  it_behaves_like 'an API request'
37
50
  it_behaves_like 'a successful request'
38
- it 'performs a get and returns the response' do
39
- expect(results).to have_key(:records)
40
- end
51
+ it_behaves_like 'performs a GET request'
52
+ it_behaves_like 'a correct query builder', {
53
+ '*date_created': {'$gte': '2021-01-08T00:00:00%2B00:00',
54
+ '$lt': '2021-01-09T00:00:00%2B00:00'}
55
+ }
56
+ end
41
57
 
42
- it 'builds query and sends proper request' do
43
- list
44
- json_filter = {
45
- '*date_created': {'$gte': '2021-01-08T00:00:00%2B00:00',
46
- '$lt': '2021-01-09T00:00:00%2B00:00'}
47
- }.to_json
48
- encoded_filter = ERB::Util.url_encode json_filter
49
- url = "#{versioned_api_path}/screenings?filter=#{encoded_filter}"
58
+ context 'with progress' do
59
+ let(:params) { {progress: 10} }
50
60
 
51
- expect(WebMock).to have_requested(:get, url)
52
- end
61
+ it_behaves_like 'an API request'
62
+ it_behaves_like 'a successful request'
63
+ it_behaves_like 'performs a GET request'
64
+ it_behaves_like 'a correct query builder', {progress: 10}
53
65
  end
54
- # rubocop:enable RSpec/ExampleLength
55
66
 
56
- # rubocop:disable RSpec/ExampleLength
57
67
  context 'with searchTerm' do
58
68
  let(:params) { {searchTerm: 'le term'} }
59
69
 
60
70
  it_behaves_like 'an API request'
61
71
  it_behaves_like 'a successful request'
62
- it 'performs a get and returns the response' do
63
- expect(results).to have_key(:records)
64
- end
65
-
66
- it 'builds query and sends proper request' do
67
- list
68
- json_filter = {'$or': [{'consumer.public_id': 'le term'},
69
- {'consumer.email': 'le term'},
70
- {'consumer.first_name': 'le term'},
71
- {'consumer.last_name': 'le term'},
72
- {'consumer.external_id': 'le term'},
73
- {'consumer.first_name': 'le'},
74
- {'consumer.last_name': 'le'},
75
- {'consumer.first_name': 'term'},
76
- {'consumer.last_name': 'term'}]}.to_json
77
- encoded_filter = ERB::Util.url_encode json_filter
78
- url = "#{versioned_api_path}/screenings?filter=#{encoded_filter}"
79
-
80
- expect(WebMock).to have_requested(:get, url)
81
- end
72
+ it_behaves_like 'performs a GET request'
73
+ it_behaves_like 'a correct query builder', {
74
+ '$or': [{'consumer.public_id': 'le term'},
75
+ {'consumer.email': 'le term'},
76
+ {'consumer.first_name': 'le term'},
77
+ {'consumer.last_name': 'le term'},
78
+ {'consumer.external_id': 'le term'},
79
+ {'consumer.first_name': 'le'},
80
+ {'consumer.last_name': 'le'},
81
+ {'consumer.first_name': 'term'},
82
+ {'consumer.last_name': 'term'}]
83
+ }
82
84
  end
83
- # rubocop:enable RSpec/ExampleLength
84
85
  end
85
86
 
86
87
  context 'with invalid params' do
@@ -94,9 +95,7 @@ RSpec.describe FinApps::REST::Screenings do
94
95
 
95
96
  it_behaves_like 'an API request'
96
97
  it_behaves_like 'a successful request'
97
- it('performs a get and returns the response') do
98
- expect(results).to have_key(:records)
99
- end
98
+ it_behaves_like 'performs a GET request'
100
99
  end
101
100
  end
102
101
 
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.4.0
4
+ version: 6.4.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: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core