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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5bcaa6d95acfee673748592f7f9d9f194ec1613266091cae68c9ec3e4db4492
4
- data.tar.gz: 384913ddd890b6c7e4f5bf13ec1a69aa52d8503c72489f526f87f1faca82e42c
3
+ metadata.gz: 1c47f3bb9f6e6702acf5a530b1e9c243a80271bc66e4eecec1fa6c1a088e99e0
4
+ data.tar.gz: fe0770b6dbe32afe9997a8d631ff5dae85c1963e0b6b26ac52bfec4cf2794159
5
5
  SHA512:
6
- metadata.gz: c66633e84b08db5b9aa4047cdbc9aec57e2cf0f73497389f1748a7f952ff4007b83b99dce7c64c34f82cefd2521ec49014ea6aa4489957b947c88df17d21ef44
7
- data.tar.gz: ce41307748a75ae249eaea3efee34d465171a55cb7cf5a4c8c05ed33cede52694d2c2518979aad0f4e87d620266598f7110c9d6971ed07d424d0f63cae5aefac
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': to_rfc_date(from_date.to_s)}
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': to_rfc_date(to_date.to_s)}
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.4.2'
4
+ VERSION = '6.4.3'
5
5
  end
@@ -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 'performs a GET request' do
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: '08/01/2021', toDate: '09/01/2021'} }
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': '2021-01-08T00:00:00%2B00:00',
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 'performs a GET request'
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.2
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-22 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core