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 +4 -4
- data/lib/finapps/rest/screenings.rb +1 -1
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/documents_orders_spec.rb +1 -1
- data/spec/rest/screenings_spec.rb +43 -44
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 685415494dde868b2db873ce98d626c4ed45f4e96604b475c1db6fcd892abbeb
|
4
|
+
data.tar.gz: 0b4b6599766968bee2752b7d2e968c9d856a9f56f0ebfe1d33d411f3d57e6579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eab93c5894770567f201112caf3b93455c4d473aa20c8e466a9aafb0afdbe6a6dd556d55efa10db62af89f6b41d3b332c04b162b4f728c712ff0982c9843bd1b
|
7
|
+
data.tar.gz: c008d2a8dffc8be3e359c95bd7de30f07de6c26b12d2d7bfbb382553eaa108d5228e652fe56ce10ef7be9b91abaafe753fc4644c50ab928d06f86d7db3889370
|
data/lib/finapps/version.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
43
|
-
|
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
|
-
|
52
|
-
|
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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|