finapps 5.0.3 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -7
- data/.tmuxinator.yml +19 -0
- data/Guardfile +42 -0
- data/finapps.gemspec +3 -1
- data/lib/finapps.rb +1 -7
- data/lib/finapps/rest/client.rb +5 -10
- data/lib/finapps/rest/consumers.rb +2 -1
- data/lib/finapps/rest/operators.rb +8 -2
- data/lib/finapps/rest/order_reports.rb +2 -1
- data/lib/finapps/rest/orders.rb +11 -9
- data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +15 -0
- data/lib/finapps/rest/portfolios_alerts.rb +2 -1
- data/lib/finapps/rest/portfolios_available_consumers.rb +2 -1
- data/lib/finapps/rest/portfolios_consumers.rb +6 -1
- data/lib/finapps/rest/products.rb +1 -2
- data/lib/finapps/rest/sessions.rb +8 -2
- data/lib/finapps/rest/statements.rb +2 -1
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/alert_definitions_spec.rb +12 -7
- data/spec/rest/alert_occurrences_spec.rb +17 -5
- data/spec/rest/client_spec.rb +115 -57
- data/spec/rest/consumers_portfolios_spec.rb +9 -4
- data/spec/rest/consumers_spec.rb +76 -20
- data/spec/rest/operators_password_resets_spec.rb +19 -10
- data/spec/rest/operators_spec.rb +60 -22
- data/spec/rest/order_assignments_spec.rb +11 -5
- data/spec/rest/order_notifications_spec.rb +6 -2
- data/spec/rest/order_refreshes_spec.rb +11 -5
- data/spec/rest/order_reports_spec.rb +15 -5
- data/spec/rest/order_statuses_spec.rb +12 -4
- data/spec/rest/order_tokens_spec.rb +17 -5
- data/spec/rest/orders_spec.rb +80 -34
- data/spec/rest/password_resets_spec.rb +51 -14
- data/spec/rest/plaid/plaid_webhooks_spec.rb +7 -3
- data/spec/rest/portfolio_reports_spec.rb +9 -4
- data/spec/rest/portfolios_alerts_spec.rb +18 -10
- data/spec/rest/portfolios_available_consumers_spec.rb +9 -4
- data/spec/rest/portfolios_consumers_spec.rb +29 -11
- data/spec/rest/portfolios_spec.rb +51 -22
- data/spec/rest/products_spec.rb +5 -2
- data/spec/rest/sessions_spec.rb +36 -14
- data/spec/rest/statements_spec.rb +6 -2
- data/spec/rest/tenant_app_settings_spec.rb +13 -5
- data/spec/rest/tenant_settings_spec.rb +13 -5
- data/spec/rest/version_spec.rb +3 -1
- data/spec/spec_helper.rb +6 -4
- data/spec/spec_helpers/client.rb +2 -1
- data/spec/support/fake_api.rb +253 -119
- data/spec/utils/query_builder_spec.rb +8 -3
- data/tags +6 -0
- metadata +48 -25
- data/lib/finapps/rest/consumer_institution_refresh.rb +0 -14
- data/lib/finapps/rest/consumer_institution_refreshes.rb +0 -12
- data/lib/finapps/rest/institutions.rb +0 -34
- data/lib/finapps/rest/institutions_forms.rb +0 -14
- data/lib/finapps/rest/user_institutions.rb +0 -54
- data/lib/finapps/rest/user_institutions_forms.rb +0 -14
- data/lib/finapps/rest/user_institutions_statuses.rb +0 -19
- data/spec/rest/consumer_institution_refresh_spec.rb +0 -44
- data/spec/rest/consumer_institution_refreshes_spec.rb +0 -20
- data/spec/rest/institutions_forms_spec.rb +0 -29
- data/spec/rest/institutions_spec.rb +0 -55
- data/spec/rest/user_institutions_forms_spec.rb +0 -30
- data/spec/rest/user_institutions_spec.rb +0 -144
- data/spec/rest/user_institutions_statuses_spec.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '095e2b6352f9f63b6ad47ff7dc24a5a57badbe81c07395b248cc8d2106b95e2e'
|
4
|
+
data.tar.gz: 75df3521c3058b8e5693a506b7cd7da232b434e38299aae0a34bc91361f6373a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471c9ab99b5048b6ccf6fe069b447182e2480b4d4d41923720576ddb580cce693fa9f71f115594aa8d6bc6ade620d0de4b6c2994f6b8851cfbf424b73c368d0c
|
7
|
+
data.tar.gz: 16fa7ed1754577cb389a5cfad5c511d35ae3b764a57292313a30fb38198e6ab341a6f5fc91c87b44a6c89246938406abfc302734d546da0fac5dd87a219ac0e4
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -13,12 +13,6 @@ Metrics/LineLength:
|
|
13
13
|
Style/AccessModifierDeclarations:
|
14
14
|
Enabled: false
|
15
15
|
|
16
|
-
Layout/SpaceInsideBlockBraces:
|
17
|
-
# The space here provides no real gain in readability while consuming
|
18
|
-
# horizontal space that could be used for a better parameter name.
|
19
|
-
# Also {| differentiates better from a hash than { | does.
|
20
|
-
SpaceBeforeBlockParameters: false
|
21
|
-
|
22
16
|
Style/CollectionMethods:
|
23
17
|
Description: Preferred collection methods.
|
24
18
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
@@ -98,4 +92,4 @@ Style/VariableInterpolation:
|
|
98
92
|
Lint/HandleExceptions:
|
99
93
|
Description: Don't suppress exception.
|
100
94
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
101
|
-
Enabled: false
|
95
|
+
Enabled: false
|
data/.tmuxinator.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
name: ruby-client
|
3
|
+
root: ~/projects/ruby-client/
|
4
|
+
windows:
|
5
|
+
-
|
6
|
+
editor:
|
7
|
+
layout: main-vertical
|
8
|
+
panes:
|
9
|
+
- vim: $EDITOR
|
10
|
+
- bash:
|
11
|
+
- git pull
|
12
|
+
- git status
|
13
|
+
- bundle
|
14
|
+
-
|
15
|
+
guard:
|
16
|
+
layout: even-horizontal
|
17
|
+
panes:
|
18
|
+
- guard:
|
19
|
+
- bundle exec guard
|
data/Guardfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
## Uncomment and set this to only include directories you want to watch
|
7
|
+
# directories %w(app lib config test spec features) \
|
8
|
+
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
9
|
+
|
10
|
+
## Note: if you are using the `directories` clause above and you are not
|
11
|
+
## watching the project directory ('.'), then you will want to move
|
12
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
13
|
+
#
|
14
|
+
# $ mkdir config
|
15
|
+
# $ mv Guardfile config/
|
16
|
+
# $ ln -s config/Guardfile .
|
17
|
+
#
|
18
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
19
|
+
|
20
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
21
|
+
# rspec may be run, below are examples of the most common uses.
|
22
|
+
# * bundler: 'bundle exec rspec'
|
23
|
+
# * bundler binstubs: 'bin/rspec'
|
24
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
25
|
+
# installed the spring binstubs per the docs)
|
26
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
27
|
+
# * 'just' rspec: 'rspec'
|
28
|
+
|
29
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
30
|
+
require 'guard/rspec/dsl'
|
31
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
end
|
data/finapps.gemspec
CHANGED
@@ -20,11 +20,13 @@ 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.1'
|
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'
|
27
27
|
spec.add_development_dependency 'gem-release', '~> 2.0', '>= 2.0.3'
|
28
|
+
spec.add_development_dependency 'guard', '~> 2.15', '>= 2.15.0'
|
29
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
|
28
30
|
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.2'
|
29
31
|
spec.add_development_dependency 'rspec', '~> 3.8', '>= 3.8.0'
|
30
32
|
spec.add_development_dependency 'rubocop', '~> 0.73', '>= 0.73.0'
|
data/lib/finapps.rb
CHANGED
@@ -6,16 +6,9 @@ require 'faraday_middleware'
|
|
6
6
|
require 'finapps_core'
|
7
7
|
require 'finapps/rest/version'
|
8
8
|
require 'finapps/rest/consumers'
|
9
|
-
require 'finapps/rest/consumer_institution_refreshes'
|
10
|
-
require 'finapps/rest/consumer_institution_refresh'
|
11
9
|
require 'finapps/rest/sessions'
|
12
10
|
require 'finapps/rest/order_tokens'
|
13
11
|
require 'finapps/rest/orders'
|
14
|
-
require 'finapps/rest/institutions_forms'
|
15
|
-
require 'finapps/rest/institutions'
|
16
|
-
require 'finapps/rest/user_institutions_statuses'
|
17
|
-
require 'finapps/rest/user_institutions'
|
18
|
-
require 'finapps/rest/user_institutions_forms'
|
19
12
|
require 'finapps/rest/order_reports'
|
20
13
|
require 'finapps/rest/order_statuses'
|
21
14
|
require 'finapps/rest/order_notifications'
|
@@ -37,6 +30,7 @@ require 'finapps/rest/portfolios_alerts'
|
|
37
30
|
require 'finapps/rest/portfolios_consumers'
|
38
31
|
require 'finapps/rest/consumers_portfolios'
|
39
32
|
require 'finapps/rest/portfolio_reports'
|
33
|
+
|
40
34
|
require 'finapps/rest/plaid/plaid_webhooks'
|
41
35
|
|
42
36
|
require 'finapps/utils/query_builder'
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -10,8 +10,6 @@ module FinApps
|
|
10
10
|
alert_definitions
|
11
11
|
alert_occurrences
|
12
12
|
consumers_portfolios
|
13
|
-
institutions
|
14
|
-
institutions_forms
|
15
13
|
orders
|
16
14
|
order_assignments
|
17
15
|
order_notifications
|
@@ -29,15 +27,9 @@ module FinApps
|
|
29
27
|
portfolios_consumers
|
30
28
|
portfolio_reports
|
31
29
|
sessions
|
32
|
-
statements
|
33
30
|
consumers
|
34
|
-
consumer_institution_refreshes
|
35
|
-
consumer_institution_refresh
|
36
31
|
tenant_settings
|
37
32
|
tenant_app_settings
|
38
|
-
user_institutions
|
39
|
-
user_institutions_forms
|
40
|
-
user_institutions_statuses
|
41
33
|
version
|
42
34
|
plaid_webhooks
|
43
35
|
].freeze
|
@@ -57,7 +49,8 @@ module FinApps
|
|
57
49
|
class_name = camelize(symbol.to_s)
|
58
50
|
variable = "@#{class_name.downcase}"
|
59
51
|
unless instance_variable_defined? variable
|
60
|
-
klass =
|
52
|
+
klass =
|
53
|
+
Object.const_get('FinApps').const_get('REST').const_get class_name
|
61
54
|
instance_variable_set(variable, klass.new(self))
|
62
55
|
end
|
63
56
|
instance_variable_get(variable)
|
@@ -75,7 +68,9 @@ module FinApps
|
|
75
68
|
def camelize(term)
|
76
69
|
string = term.to_s
|
77
70
|
string = string.sub(/^[a-z\d]*/) { $&.capitalize }
|
78
|
-
string.gsub(%r{(?:_|(/))([a-z\d]*)})
|
71
|
+
string.gsub(%r{(?:_|(/))([a-z\d]*)}) do
|
72
|
+
Regexp.last_match(2).capitalize.to_s
|
73
|
+
end
|
79
74
|
end
|
80
75
|
end
|
81
76
|
end
|
@@ -21,7 +21,8 @@ module FinApps
|
|
21
21
|
not_blank(public_id, :public_id)
|
22
22
|
not_blank(params, :params)
|
23
23
|
|
24
|
-
path =
|
24
|
+
path =
|
25
|
+
"#{end_point}/#{ERB::Util.url_encode(public_id)}#{'/password' if password_update?(params)}"
|
25
26
|
super params, path
|
26
27
|
end
|
27
28
|
|
@@ -51,7 +51,9 @@ module FinApps
|
|
51
51
|
private
|
52
52
|
|
53
53
|
def validates(params)
|
54
|
-
params.key?(:password) && params[:password] &&
|
54
|
+
params.key?(:password) && params[:password] &&
|
55
|
+
params.key?(:password_confirm) &&
|
56
|
+
params[:password_confirm]
|
55
57
|
end
|
56
58
|
|
57
59
|
def build_filter(params)
|
@@ -66,7 +68,11 @@ module FinApps
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def role_query(role)
|
69
|
-
role.is_a?(Array)
|
71
|
+
if role.is_a?(Array)
|
72
|
+
{ "role": { "$in": role.map(&:to_i) } }
|
73
|
+
else
|
74
|
+
{ "role": role.to_i }
|
75
|
+
end
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
@@ -8,7 +8,8 @@ module FinApps
|
|
8
8
|
not_blank(format, :format)
|
9
9
|
raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: format' unless accepted_format?(format)
|
10
10
|
|
11
|
-
path =
|
11
|
+
path =
|
12
|
+
"orders/#{ERB::Util.url_encode(id)}/report.#{ERB::Util.url_encode(format)}"
|
12
13
|
super nil, path
|
13
14
|
end
|
14
15
|
|
data/lib/finapps/rest/orders.rb
CHANGED
@@ -68,22 +68,24 @@ module FinApps
|
|
68
68
|
def search_query(term)
|
69
69
|
{
|
70
70
|
"$or": [
|
71
|
-
{ "public_id": {
|
72
|
-
"$regex": "^#{term}",
|
73
|
-
"$options": 'i'
|
74
|
-
} },
|
71
|
+
{ "public_id": { "$regex": "^#{term}", "$options": 'i' } },
|
75
72
|
{ "applicant.last_name": term },
|
76
73
|
{ "assignment.last_name": term },
|
77
|
-
{
|
78
|
-
"
|
79
|
-
|
80
|
-
|
74
|
+
{
|
75
|
+
"requestor.reference_no": {
|
76
|
+
"$regex": "^#{term}", "$options": 'i'
|
77
|
+
}
|
78
|
+
}
|
81
79
|
]
|
82
80
|
}
|
83
81
|
end
|
84
82
|
|
85
83
|
def status_query(status)
|
86
|
-
status.is_a?(Array)
|
84
|
+
if status.is_a?(Array)
|
85
|
+
{ "status": { "$in": status.map(&:to_i) } }
|
86
|
+
else
|
87
|
+
{ "status": status.to_i }
|
88
|
+
end
|
87
89
|
end
|
88
90
|
|
89
91
|
def assignment_query(assignment)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FinApps
|
4
|
+
module REST
|
5
|
+
class PlaidConsumerInstitutions < FinAppsCore::REST::Resources # :nodoc:
|
6
|
+
def create(params)
|
7
|
+
super(params, 'p/institution/consumer')
|
8
|
+
end
|
9
|
+
|
10
|
+
def list
|
11
|
+
super 'p/institution/consumer'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -26,7 +26,8 @@ module FinApps
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def build_path(portfolio_id, alert_id = nil)
|
29
|
-
alert_path =
|
29
|
+
alert_path =
|
30
|
+
alert_id ? "alerts/#{ERB::Util.url_encode(alert_id)}" : 'alerts'
|
30
31
|
"portfolios/#{ERB::Util.url_encode(portfolio_id)}/" + alert_path
|
31
32
|
end
|
32
33
|
end
|
@@ -8,7 +8,8 @@ module FinApps
|
|
8
8
|
def list(portfolio_id, params = nil)
|
9
9
|
not_blank(portfolio_id, :portfolio_id)
|
10
10
|
|
11
|
-
path =
|
11
|
+
path =
|
12
|
+
"portfolios/#{ERB::Util.url_encode(portfolio_id)}/consumers/available"
|
12
13
|
return super path if params.nil?
|
13
14
|
|
14
15
|
raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
|
@@ -37,7 +37,12 @@ module FinApps
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def build_path(portfolio_id, consumer_id = nil)
|
40
|
-
consumer_path =
|
40
|
+
consumer_path =
|
41
|
+
if consumer_id
|
42
|
+
"consumers/#{ERB::Util.url_encode(consumer_id)}"
|
43
|
+
else
|
44
|
+
'consumers'
|
45
|
+
end
|
41
46
|
"portfolios/#{ERB::Util.url_encode(portfolio_id)}/" + consumer_path
|
42
47
|
end
|
43
48
|
end
|
@@ -15,7 +15,12 @@ module FinApps
|
|
15
15
|
begin
|
16
16
|
super params, path
|
17
17
|
rescue FinAppsCore::ApiUnauthenticatedError
|
18
|
-
return [
|
18
|
+
return [
|
19
|
+
nil,
|
20
|
+
[
|
21
|
+
"Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"
|
22
|
+
]
|
23
|
+
]
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
@@ -26,7 +31,8 @@ module FinApps
|
|
26
31
|
private
|
27
32
|
|
28
33
|
def validates(params)
|
29
|
-
params.key?(:email) && params[:email] && params.key?(:password) &&
|
34
|
+
params.key?(:email) && params[:email] && params.key?(:password) &&
|
35
|
+
params[:password]
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
@@ -7,7 +7,8 @@ module FinApps
|
|
7
7
|
not_blank(account_id, :account_id)
|
8
8
|
not_blank(document_id, :document_id)
|
9
9
|
|
10
|
-
path =
|
10
|
+
path =
|
11
|
+
"accounts/#{ERB::Util.url_encode(account_id)}/statement/#{ERB::Util.url_encode(document_id)}"
|
11
12
|
super nil, path
|
12
13
|
end
|
13
14
|
end
|
data/lib/finapps/version.rb
CHANGED
@@ -16,7 +16,9 @@ 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
|
-
it('performs a get and returns the response')
|
19
|
+
it('performs a get and returns the response') do
|
20
|
+
expect(results).to have_key(:records)
|
21
|
+
end
|
20
22
|
it('returns no error messages') { expect(errors).to be_empty }
|
21
23
|
end
|
22
24
|
|
@@ -31,12 +33,15 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
31
33
|
|
32
34
|
it { expect { list }.not_to raise_error }
|
33
35
|
it('returns an array') { expect(list).to be_a(Array) }
|
34
|
-
it('performs a get and returns the response')
|
36
|
+
it('performs a get and returns the response') do
|
37
|
+
expect(results).to have_key(:records)
|
38
|
+
end
|
35
39
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
40
|
it 'builds query and sends proper request' do
|
37
41
|
list
|
38
|
-
url =
|
39
|
-
|
42
|
+
url =
|
43
|
+
"#{versioned_api_path}/portfolio/alerts/definitions?page=2&requested=25&" \
|
44
|
+
'sort=-created_date'
|
40
45
|
expect(WebMock).to have_requested(:get, url)
|
41
46
|
end
|
42
47
|
end
|
@@ -56,11 +61,11 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
56
61
|
context 'when valid id is provided' do
|
57
62
|
let(:id) { 'valid_id' }
|
58
63
|
|
59
|
-
it { expect { show }.not_to raise_error
|
64
|
+
it { expect { show }.not_to raise_error }
|
60
65
|
it('returns an array') { expect(show).to be_a(Array) }
|
61
66
|
it('performs a get and returns the response') do
|
62
|
-
expect(results).to
|
63
|
-
expect(results).to
|
67
|
+
expect(results).to have_key(:_id)
|
68
|
+
expect(results).to have_key(:rule_name)
|
64
69
|
end
|
65
70
|
it('returns no error messages') { expect(errors).to be_empty }
|
66
71
|
end
|
@@ -16,7 +16,9 @@ RSpec.describe FinApps::REST::AlertOccurrences 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
|
-
it('performs a get and returns the response')
|
19
|
+
it('performs a get and returns the response') do
|
20
|
+
expect(results).to have_key(:records)
|
21
|
+
end
|
20
22
|
it('returns no error messages') { expect(errors).to be_empty }
|
21
23
|
end
|
22
24
|
|
@@ -27,16 +29,26 @@ RSpec.describe FinApps::REST::AlertOccurrences do
|
|
27
29
|
end
|
28
30
|
|
29
31
|
context 'when including valid params' do
|
30
|
-
let(:params)
|
32
|
+
let(:params) do
|
33
|
+
{
|
34
|
+
page: 2,
|
35
|
+
sort: '-created_date',
|
36
|
+
requested: 25,
|
37
|
+
portfolio_id: 'valid_id'
|
38
|
+
}
|
39
|
+
end
|
31
40
|
|
32
41
|
it { expect { list }.not_to raise_error }
|
33
42
|
it('returns an array') { expect(list).to be_a(Array) }
|
34
|
-
it('performs a get and returns the response')
|
43
|
+
it('performs a get and returns the response') do
|
44
|
+
expect(results).to have_key(:records)
|
45
|
+
end
|
35
46
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
47
|
it 'builds query and sends proper request' do
|
37
48
|
list
|
38
|
-
url =
|
39
|
-
|
49
|
+
url =
|
50
|
+
"#{versioned_api_path}/portfolio/alerts/occurrences?" \
|
51
|
+
'filter=%7B%22portfolio_id%22:%22valid_id%22%7D&page=2&requested=25&sort=-created_date'
|
40
52
|
expect(WebMock).to have_requested(:get, url)
|
41
53
|
end
|
42
54
|
end
|