finapps 6.4.2 → 6.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/finapps/rest/screenings.rb +2 -7
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/screenings_spec.rb +30 -18
- 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: 1c47f3bb9f6e6702acf5a530b1e9c243a80271bc66e4eecec1fa6c1a088e99e0
|
4
|
+
data.tar.gz: fe0770b6dbe32afe9997a8d631ff5dae85c1963e0b6b26ac52bfec4cf2794159
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb6e96b56b2e64f03eef52e9e5f4573eca2c9940421caa3d15dc42b3fd400781a40bfd44fe592b7886ebf4cd0de3f9854e080a60c85454f0228919524ed513a9
|
7
|
+
data.tar.gz: 3762f06a6f148e7dd040c9005e98614f9bcdd54f497a1b6f1e7a1d148bc5e528852592e3ff4ecaec2df5a8419cc95a53f299e02c292d5d1285e5e28b61575060
|
@@ -98,18 +98,13 @@ module FinApps
|
|
98
98
|
def from_filter(from_date)
|
99
99
|
return {} unless from_date
|
100
100
|
|
101
|
-
{'$gte':
|
101
|
+
{'$gte': from_date}
|
102
102
|
end
|
103
103
|
|
104
104
|
def to_filter(to_date)
|
105
105
|
return {} unless to_date
|
106
106
|
|
107
|
-
{'$lt':
|
108
|
-
end
|
109
|
-
|
110
|
-
def to_rfc_date(str)
|
111
|
-
date = DateTime.parse(str)
|
112
|
-
date.rfc3339
|
107
|
+
{'$lt': to_date}
|
113
108
|
end
|
114
109
|
|
115
110
|
def progress_filter(progress)
|
data/lib/finapps/version.rb
CHANGED
@@ -15,11 +15,14 @@ RSpec.describe FinApps::REST::Screenings do
|
|
15
15
|
context 'with valid params' do
|
16
16
|
let(:params) { {} }
|
17
17
|
|
18
|
-
RSpec.shared_examples '
|
18
|
+
RSpec.shared_examples 'a GET request' do
|
19
19
|
it { expect(results).to have_key(:records) }
|
20
20
|
end
|
21
21
|
|
22
22
|
RSpec.shared_examples 'a correct query builder' do |filter|
|
23
|
+
it_behaves_like 'an API request'
|
24
|
+
it_behaves_like 'a successful request'
|
25
|
+
it_behaves_like 'a GET request'
|
23
26
|
it 'builds query and sends proper request' do
|
24
27
|
list
|
25
28
|
encoded_filter = ERB::Util.url_encode filter.to_json
|
@@ -32,9 +35,6 @@ RSpec.describe FinApps::REST::Screenings do
|
|
32
35
|
context 'without searchTerm' do
|
33
36
|
let(:params) { {searchTerm: nil, page: 2} }
|
34
37
|
|
35
|
-
it_behaves_like 'an API request'
|
36
|
-
it_behaves_like 'a successful request'
|
37
|
-
it_behaves_like 'performs a GET request'
|
38
38
|
it 'builds query and sends proper request' do
|
39
39
|
list
|
40
40
|
url = "#{versioned_api_path}/screenings?page=2"
|
@@ -43,33 +43,45 @@ RSpec.describe FinApps::REST::Screenings do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
context 'with from date' do
|
47
|
+
let(:params) { {fromDate: 'from'} }
|
48
|
+
|
49
|
+
it_behaves_like 'a correct query builder', {
|
50
|
+
'*date_created': {'$gte': 'from'}
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'with to date' do
|
55
|
+
let(:params) { {toDate: 'to'} }
|
56
|
+
|
57
|
+
it_behaves_like 'a correct query builder', {
|
58
|
+
'*date_created': {'$lt': 'to'}
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
46
62
|
context 'with date range' do
|
47
|
-
let(:params) { {fromDate: '
|
63
|
+
let(:params) { {fromDate: 'from', toDate: 'to'} }
|
48
64
|
|
49
|
-
it_behaves_like 'an API request'
|
50
|
-
it_behaves_like 'a successful request'
|
51
|
-
it_behaves_like 'performs a GET request'
|
52
65
|
it_behaves_like 'a correct query builder', {
|
53
|
-
'*date_created': {'$gte': '
|
54
|
-
'$lt': '2021-01-09T00:00:00%2B00:00'}
|
66
|
+
'*date_created': {'$gte': 'from', '$lt': 'to'}
|
55
67
|
}
|
56
68
|
end
|
57
69
|
|
58
|
-
context 'with progress' do
|
70
|
+
context 'with invalid progress' do
|
71
|
+
let(:params) { {progress: 'xyz'} }
|
72
|
+
|
73
|
+
it_behaves_like 'a correct query builder', {progress: 0}
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'with valid progress' do
|
59
77
|
let(:params) { {progress: 10} }
|
60
78
|
|
61
|
-
it_behaves_like 'an API request'
|
62
|
-
it_behaves_like 'a successful request'
|
63
|
-
it_behaves_like 'performs a GET request'
|
64
79
|
it_behaves_like 'a correct query builder', {progress: 10}
|
65
80
|
end
|
66
81
|
|
67
82
|
context 'with searchTerm' do
|
68
83
|
let(:params) { {searchTerm: 'le term'} }
|
69
84
|
|
70
|
-
it_behaves_like 'an API request'
|
71
|
-
it_behaves_like 'a successful request'
|
72
|
-
it_behaves_like 'performs a GET request'
|
73
85
|
it_behaves_like 'a correct query builder', {
|
74
86
|
'$or': [{'consumer.public_id': 'le term'},
|
75
87
|
{'consumer.email': 'le term'},
|
@@ -95,7 +107,7 @@ RSpec.describe FinApps::REST::Screenings do
|
|
95
107
|
|
96
108
|
it_behaves_like 'an API request'
|
97
109
|
it_behaves_like 'a successful request'
|
98
|
-
it_behaves_like '
|
110
|
+
it_behaves_like 'a GET request'
|
99
111
|
end
|
100
112
|
end
|
101
113
|
|
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.3
|
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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|