finapps 5.0.29 → 5.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +2 -1
- data/.github/workflows/main.yaml +43 -0
- data/.rubocop.yml +134 -61
- data/.rubocop_todo.yml +120 -0
- data/.tmuxinator.yml +1 -0
- data/.travis.yml +3 -1
- data/RELEASES.md +31 -0
- data/finapps.gemspec +4 -4
- data/lib/finapps.rb +2 -0
- data/lib/finapps/rest/alert_definitions.rb +1 -1
- data/lib/finapps/rest/alert_occurrences.rb +1 -1
- data/lib/finapps/rest/client.rb +2 -0
- data/lib/finapps/rest/consumers.rb +22 -6
- data/lib/finapps/rest/consumers_portfolios.rb +1 -1
- data/lib/finapps/rest/documents_orders.rb +43 -25
- data/lib/finapps/rest/documents_orders_notifications.rb +14 -0
- data/lib/finapps/rest/operators.rb +5 -5
- data/lib/finapps/rest/operators_password_resets.rb +1 -1
- data/lib/finapps/rest/order_assignments.rb +1 -1
- data/lib/finapps/rest/order_reports.rb +1 -1
- data/lib/finapps/rest/orders.rb +10 -10
- data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +1 -1
- data/lib/finapps/rest/portfolio_reports.rb +1 -1
- data/lib/finapps/rest/portfolios.rb +1 -1
- data/lib/finapps/rest/portfolios_available_consumers.rb +1 -1
- data/lib/finapps/rest/portfolios_consumers.rb +1 -1
- data/lib/finapps/rest/sessions.rb +1 -1
- data/lib/finapps/rest/signed_documents_downloads.rb +17 -0
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/alert_definitions_spec.rb +10 -2
- data/spec/rest/alert_occurrences_spec.rb +6 -1
- data/spec/rest/api_request.rb +1 -0
- data/spec/rest/client_spec.rb +2 -2
- data/spec/rest/consumers_portfolios_spec.rb +7 -2
- data/spec/rest/consumers_spec.rb +54 -7
- data/spec/rest/documents_orders_notifications_spec.rb +42 -0
- data/spec/rest/documents_orders_spec.rb +95 -17
- data/spec/rest/esign_templates_spec.rb +2 -1
- data/spec/rest/operators_password_resets_spec.rb +6 -1
- data/spec/rest/operators_spec.rb +22 -2
- data/spec/rest/order_assignments_spec.rb +6 -1
- data/spec/rest/order_notifications_spec.rb +3 -1
- data/spec/rest/order_refreshes_spec.rb +7 -1
- data/spec/rest/order_reports_spec.rb +7 -1
- data/spec/rest/order_statuses_spec.rb +7 -3
- data/spec/rest/order_tokens_spec.rb +7 -1
- data/spec/rest/orders_spec.rb +63 -29
- data/spec/rest/password_resets_spec.rb +20 -10
- data/spec/rest/plaid/plaid_account_permissions_spec.rb +5 -4
- data/spec/rest/plaid/plaid_accounts_spec.rb +9 -4
- data/spec/rest/plaid/plaid_consumer_institutions_spec.rb +10 -10
- data/spec/rest/plaid/plaid_institution_logos_spec.rb +1 -1
- data/spec/rest/plaid/plaid_webhooks_spec.rb +3 -1
- data/spec/rest/portfolio_reports_spec.rb +7 -2
- data/spec/rest/portfolios_alerts_spec.rb +6 -1
- data/spec/rest/portfolios_available_consumers_spec.rb +7 -2
- data/spec/rest/portfolios_consumers_spec.rb +13 -2
- data/spec/rest/portfolios_spec.rb +20 -5
- data/spec/rest/products_spec.rb +3 -1
- data/spec/rest/sessions_spec.rb +8 -4
- data/spec/rest/signed_documents_downloads_spec.rb +35 -0
- data/spec/rest/tenant_app_settings_spec.rb +9 -3
- data/spec/rest/tenant_settings_spec.rb +9 -3
- data/spec/rest/verix/verix_documents_spec.rb +13 -20
- data/spec/rest/verix/verix_metadata_spec.rb +1 -1
- data/spec/rest/verix/verix_pdf_documents_spec.rb +14 -19
- data/spec/rest/verix/verix_records_spec.rb +31 -10
- data/spec/rest/version_spec.rb +3 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fake_api.rb +20 -3
- data/spec/support/fixtures/documents_orders_none.json +6 -0
- data/spec/support/fixtures/signed_document.pdf +0 -0
- data/spec/utils/query_builder_spec.rb +40 -14
- metadata +26 -16
data/finapps.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = Dir['spec/**/*.rb']
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.
|
23
|
+
spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.10'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
|
26
26
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
|
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
|
30
30
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
33
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
34
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 0.86', '>= 0.86.0'
|
33
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.6', '>= 1.6.1'
|
34
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.40', '>= 1.40.0'
|
35
35
|
spec.add_development_dependency 'sinatra', '~> 2.0', '>= 2.0.8'
|
36
36
|
spec.add_development_dependency 'webmock', '~> 3.8', '>= 3.8.0'
|
37
37
|
|
data/lib/finapps.rb
CHANGED
@@ -31,6 +31,8 @@ require 'finapps/rest/consumers_portfolios'
|
|
31
31
|
require 'finapps/rest/portfolio_reports'
|
32
32
|
require 'finapps/rest/documents_orders'
|
33
33
|
require 'finapps/rest/esign_templates'
|
34
|
+
require 'finapps/rest/signed_documents_downloads'
|
35
|
+
require 'finapps/rest/documents_orders_notifications'
|
34
36
|
|
35
37
|
require 'finapps/rest/plaid/plaid_resources'
|
36
38
|
require 'finapps/rest/plaid/plaid_webhooks'
|
@@ -8,7 +8,7 @@ module FinApps
|
|
8
8
|
|
9
9
|
def list(params = nil)
|
10
10
|
return super END_POINT if params.nil?
|
11
|
-
|
11
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
12
12
|
|
13
13
|
super build_query_path(END_POINT, params)
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module FinApps
|
|
8
8
|
|
9
9
|
def list(params = nil)
|
10
10
|
return super END_POINT if params.nil?
|
11
|
-
|
11
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
12
12
|
|
13
13
|
super build_query_path(END_POINT, params)
|
14
14
|
end
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -12,6 +12,7 @@ module FinApps
|
|
12
12
|
consumers
|
13
13
|
consumers_portfolios
|
14
14
|
documents_orders
|
15
|
+
documents_orders_notifications
|
15
16
|
esign_templates
|
16
17
|
orders
|
17
18
|
order_assignments
|
@@ -35,6 +36,7 @@ module FinApps
|
|
35
36
|
portfolio_reports
|
36
37
|
products
|
37
38
|
sessions
|
39
|
+
signed_documents_downloads
|
38
40
|
tenant_settings
|
39
41
|
tenant_app_settings
|
40
42
|
verix_metadata
|
@@ -15,7 +15,7 @@ module FinApps
|
|
15
15
|
|
16
16
|
def list(params = nil)
|
17
17
|
return super if params.nil?
|
18
|
-
|
18
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
19
19
|
|
20
20
|
super build_query_path(end_point, params)
|
21
21
|
end
|
@@ -54,14 +54,30 @@ module FinApps
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def search_query(term)
|
57
|
+
query = with_space_search(term).concat(name_search(term))
|
57
58
|
{
|
58
|
-
"$or":
|
59
|
-
{ "email": term },
|
60
|
-
{ "first_name": term },
|
61
|
-
{ "last_name": term }
|
62
|
-
]
|
59
|
+
"$or": query
|
63
60
|
}
|
64
61
|
end
|
62
|
+
|
63
|
+
def with_space_search(term)
|
64
|
+
[
|
65
|
+
{"email": term},
|
66
|
+
{"first_name": term},
|
67
|
+
{"last_name": term}
|
68
|
+
]
|
69
|
+
end
|
70
|
+
|
71
|
+
def name_search(term)
|
72
|
+
search_arr = []
|
73
|
+
if /\s/.match?(term)
|
74
|
+
term.split.each do |t|
|
75
|
+
search_arr.append("first_name": t)
|
76
|
+
search_arr.append("last_name": t)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
search_arr
|
80
|
+
end
|
65
81
|
end
|
66
82
|
end
|
67
83
|
end
|
@@ -11,7 +11,7 @@ module FinApps
|
|
11
11
|
path = "consumers/#{ERB::Util.url_encode(id)}/portfolios"
|
12
12
|
return super path if params.nil?
|
13
13
|
|
14
|
-
|
14
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
15
15
|
|
16
16
|
super build_query_path(path, params)
|
17
17
|
end
|
@@ -10,7 +10,7 @@ module FinApps
|
|
10
10
|
def list(params = nil)
|
11
11
|
path = 'documents/orders'
|
12
12
|
return super(path) if params.nil?
|
13
|
-
|
13
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
14
14
|
|
15
15
|
super build_query_path(path, params)
|
16
16
|
end
|
@@ -46,41 +46,59 @@ module FinApps
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def build_filter(params)
|
49
|
-
search_query(params[:searchTerm])
|
49
|
+
search_query(params[:searchTerm])
|
50
|
+
.merge(consumer_query(params[:consumer]))
|
51
|
+
.merge(tag_query(params[:tag]))
|
52
|
+
.merge(status_query(params[:status]))
|
50
53
|
end
|
51
54
|
|
52
55
|
def search_query(term)
|
53
|
-
|
56
|
+
return {} unless term
|
57
|
+
|
58
|
+
query = with_space_search(term).concat(name_search(term))
|
59
|
+
{"$or": query}
|
60
|
+
end
|
61
|
+
|
62
|
+
def name_search(term)
|
63
|
+
search_arr = []
|
64
|
+
if /\s/.match?(term)
|
65
|
+
term.split.each do |t|
|
66
|
+
search_arr.append("applicant.first_name": t)
|
67
|
+
search_arr.append("applicant.last_name": t)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
search_arr
|
71
|
+
end
|
72
|
+
|
73
|
+
def with_space_search(term)
|
74
|
+
[
|
75
|
+
{"applicant.email": term},
|
76
|
+
{"applicant.first_name": term},
|
77
|
+
{"applicant.last_name": term},
|
54
78
|
{
|
55
|
-
"
|
56
|
-
|
57
|
-
|
58
|
-
{
|
59
|
-
"reference_no": {
|
60
|
-
"$regex": "^#{term}", "$options": 'i'
|
61
|
-
}
|
62
|
-
}
|
63
|
-
]
|
79
|
+
"reference_no": {
|
80
|
+
"$regex": "^#{term}", "$options": 'i'
|
81
|
+
}
|
64
82
|
}
|
65
|
-
|
66
|
-
{}
|
67
|
-
end
|
83
|
+
]
|
68
84
|
end
|
69
85
|
|
70
86
|
def tag_query(tag)
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
87
|
+
return {} unless tag
|
88
|
+
|
89
|
+
{"tag": tag.empty? ? nil : tag}
|
90
|
+
end
|
91
|
+
|
92
|
+
def status_query(status)
|
93
|
+
return {} unless status
|
94
|
+
|
95
|
+
{status: status}
|
76
96
|
end
|
77
97
|
|
78
98
|
def consumer_query(consumer)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
{}
|
83
|
-
end
|
99
|
+
return {} unless consumer
|
100
|
+
|
101
|
+
{"consumer_id": consumer.empty? ? nil : consumer}
|
84
102
|
end
|
85
103
|
end
|
86
104
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FinApps
|
4
|
+
module REST
|
5
|
+
class DocumentsOrdersNotifications < FinAppsCore::REST::Resources
|
6
|
+
def create(id)
|
7
|
+
not_blank(id, :id)
|
8
|
+
|
9
|
+
path = "documents/orders/#{ERB::Util.url_encode(id)}/notify"
|
10
|
+
super nil, path
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -9,7 +9,7 @@ module FinApps
|
|
9
9
|
|
10
10
|
def list(params = nil)
|
11
11
|
return super if params.nil?
|
12
|
-
|
12
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
13
13
|
|
14
14
|
super build_query_path(end_point, params)
|
15
15
|
end
|
@@ -36,7 +36,7 @@ module FinApps
|
|
36
36
|
def update_password(params)
|
37
37
|
# update password for current operator, need authorization session in header
|
38
38
|
not_blank(params, :params)
|
39
|
-
|
39
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params
|
40
40
|
|
41
41
|
path = "#{end_point}/password/change"
|
42
42
|
|
@@ -64,14 +64,14 @@ module FinApps
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def search_query(term)
|
67
|
-
{
|
67
|
+
{"last_name": term}
|
68
68
|
end
|
69
69
|
|
70
70
|
def role_query(role)
|
71
71
|
if role.is_a?(Array)
|
72
|
-
{
|
72
|
+
{"role": {"$in": role.map(&:to_i)}}
|
73
73
|
else
|
74
|
-
{
|
74
|
+
{"role": role.to_i}
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -22,7 +22,7 @@ module FinApps
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def validates_email(params)
|
25
|
-
|
25
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless email_exists? params
|
26
26
|
end
|
27
27
|
|
28
28
|
def email_exists?(params)
|
@@ -6,7 +6,7 @@ module FinApps
|
|
6
6
|
def update(id, orders_array)
|
7
7
|
not_blank(id, :operator_id)
|
8
8
|
not_blank(orders_array, :params)
|
9
|
-
|
9
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless orders_array.is_a? Array
|
10
10
|
|
11
11
|
path = "operators/#{ERB::Util.url_encode(id)}/assign"
|
12
12
|
super orders_array, path
|
@@ -6,7 +6,7 @@ module FinApps
|
|
6
6
|
def show(id, format)
|
7
7
|
not_blank(id, :id)
|
8
8
|
not_blank(format, :format)
|
9
|
-
|
9
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: format' unless accepted_format?(format)
|
10
10
|
|
11
11
|
path =
|
12
12
|
"orders/#{ERB::Util.url_encode(id)}/report.#{ERB::Util.url_encode(format)}"
|
data/lib/finapps/rest/orders.rb
CHANGED
@@ -28,7 +28,7 @@ module FinApps
|
|
28
28
|
#
|
29
29
|
def list(params = nil)
|
30
30
|
return super if params.nil?
|
31
|
-
|
31
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
32
32
|
|
33
33
|
super build_query_path(end_point, params)
|
34
34
|
end
|
@@ -66,9 +66,9 @@ module FinApps
|
|
66
66
|
if term
|
67
67
|
{
|
68
68
|
"$or": [
|
69
|
-
{
|
70
|
-
{
|
71
|
-
{
|
69
|
+
{"public_id": {"$regex": "^#{term}", "$options": 'i'}},
|
70
|
+
{"applicant.last_name": term},
|
71
|
+
{"assignment.last_name": term},
|
72
72
|
{
|
73
73
|
"requestor.reference_no": {
|
74
74
|
"$regex": "^#{term}", "$options": 'i'
|
@@ -84,9 +84,9 @@ module FinApps
|
|
84
84
|
def status_query(status)
|
85
85
|
if status
|
86
86
|
if status.is_a?(Array)
|
87
|
-
{
|
87
|
+
{"status": {"$in": status.map(&:to_i)}}
|
88
88
|
else
|
89
|
-
{
|
89
|
+
{"status": status.to_i}
|
90
90
|
end
|
91
91
|
else
|
92
92
|
{}
|
@@ -96,7 +96,7 @@ module FinApps
|
|
96
96
|
def assignment_query(assignment)
|
97
97
|
# translate "" to null assignment
|
98
98
|
if assignment
|
99
|
-
{
|
99
|
+
{"assignment.operator_id": assignment.empty? ? nil : assignment}
|
100
100
|
else
|
101
101
|
{}
|
102
102
|
end
|
@@ -104,7 +104,7 @@ module FinApps
|
|
104
104
|
|
105
105
|
def consumer_query(consumer)
|
106
106
|
if consumer
|
107
|
-
{
|
107
|
+
{"consumer_id": consumer.empty? ? nil : consumer}
|
108
108
|
else
|
109
109
|
{}
|
110
110
|
end
|
@@ -114,8 +114,8 @@ module FinApps
|
|
114
114
|
if !search_term && !nil_or_empty?(relation)
|
115
115
|
{
|
116
116
|
"$or": [
|
117
|
-
{
|
118
|
-
{
|
117
|
+
{"public_id": {"$in": relation}},
|
118
|
+
{"original_order_id": {"$in": relation}}
|
119
119
|
]
|
120
120
|
}
|
121
121
|
else
|
@@ -9,7 +9,7 @@ module FinApps
|
|
9
9
|
super(params, 'p/institution/consumer')
|
10
10
|
end
|
11
11
|
|
12
|
-
def show(id, options = {
|
12
|
+
def show(id, options = {show_accounts: false})
|
13
13
|
results, error_messages = super(nil, "p/institution/consumer/#{id}")
|
14
14
|
|
15
15
|
if error_messages.empty? && options[:show_accounts]
|
@@ -9,7 +9,7 @@ module FinApps
|
|
9
9
|
path = 'portfolio/reports'
|
10
10
|
|
11
11
|
return super path if params.nil?
|
12
|
-
|
12
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
13
13
|
|
14
14
|
super build_query_path(path, params)
|
15
15
|
end
|
@@ -7,7 +7,7 @@ module FinApps
|
|
7
7
|
|
8
8
|
def list(params = nil)
|
9
9
|
return super if params.nil?
|
10
|
-
|
10
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
11
11
|
|
12
12
|
super build_query_path(end_point, params)
|
13
13
|
end
|
@@ -12,7 +12,7 @@ module FinApps
|
|
12
12
|
"portfolios/#{ERB::Util.url_encode(portfolio_id)}/consumers/available"
|
13
13
|
return super path if params.nil?
|
14
14
|
|
15
|
-
|
15
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
16
16
|
|
17
17
|
super build_query_path(path, params)
|
18
18
|
end
|
@@ -11,7 +11,7 @@ module FinApps
|
|
11
11
|
path = build_path(portfolio_id)
|
12
12
|
return super path if params.nil?
|
13
13
|
|
14
|
-
|
14
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
15
15
|
|
16
16
|
super build_query_path(path, params)
|
17
17
|
end
|
@@ -8,7 +8,7 @@ module FinApps
|
|
8
8
|
|
9
9
|
def create(params, path = nil)
|
10
10
|
return super nil, path if path == LOGOUT
|
11
|
-
|
11
|
+
fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params
|
12
12
|
|
13
13
|
path ||= CONSUMER_LOGIN
|
14
14
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FinApps
|
4
|
+
module REST
|
5
|
+
class SignedDocumentsDownloads < FinAppsCore::REST::Resources
|
6
|
+
def show(consumer_id, signature_request_id)
|
7
|
+
not_blank(consumer_id, :consumer_id)
|
8
|
+
not_blank(signature_request_id, :signature_request_id)
|
9
|
+
|
10
|
+
path =
|
11
|
+
"consumers/#{ERB::Util.url_encode(consumer_id)}/"\
|
12
|
+
"documents/#{ERB::Util.url_encode(signature_request_id)}"
|
13
|
+
super(nil, path)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/finapps/version.rb
CHANGED
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
|
|
4
4
|
|
5
5
|
RSpec.describe FinApps::REST::AlertDefinitions do
|
6
6
|
include SpecHelpers::Client
|
7
|
-
subject {
|
7
|
+
subject { described_class.new(client) }
|
8
8
|
|
9
9
|
describe '#list' do
|
10
10
|
let(:list) { subject.list(params) }
|
@@ -16,9 +16,11 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
16
16
|
|
17
17
|
it { expect { list }.not_to raise_error }
|
18
18
|
it('returns an array') { expect(list).to be_a(Array) }
|
19
|
+
|
19
20
|
it('performs a get and returns the response') do
|
20
21
|
expect(results).to have_key(:records)
|
21
22
|
end
|
23
|
+
|
22
24
|
it('returns no error messages') { expect(errors).to be_empty }
|
23
25
|
end
|
24
26
|
|
@@ -29,14 +31,17 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
29
31
|
end
|
30
32
|
|
31
33
|
context 'when including valid params' do
|
32
|
-
let(:params) { {
|
34
|
+
let(:params) { {page: 2, sort: '-created_date', requested: 25} }
|
33
35
|
|
34
36
|
it { expect { list }.not_to raise_error }
|
35
37
|
it('returns an array') { expect(list).to be_a(Array) }
|
38
|
+
|
36
39
|
it('performs a get and returns the response') do
|
37
40
|
expect(results).to have_key(:records)
|
38
41
|
end
|
42
|
+
|
39
43
|
it('returns no error messages') { expect(errors).to be_empty }
|
44
|
+
|
40
45
|
it 'builds query and sends proper request' do
|
41
46
|
list
|
42
47
|
url =
|
@@ -63,10 +68,12 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
63
68
|
|
64
69
|
it { expect { show }.not_to raise_error }
|
65
70
|
it('returns an array') { expect(show).to be_a(Array) }
|
71
|
+
|
66
72
|
it('performs a get and returns the response') do
|
67
73
|
expect(results).to have_key(:_id)
|
68
74
|
expect(results).to have_key(:rule_name)
|
69
75
|
end
|
76
|
+
|
70
77
|
it('returns no error messages') { expect(errors).to be_empty }
|
71
78
|
end
|
72
79
|
|
@@ -75,6 +82,7 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
75
82
|
|
76
83
|
it { expect { show }.not_to raise_error }
|
77
84
|
it('results is nil') { expect(results).to be_nil }
|
85
|
+
|
78
86
|
it('error messages array is populated') do
|
79
87
|
expect(errors.first.downcase).to eq('resource not found')
|
80
88
|
end
|