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
data/spec/rest/orders_spec.rb
CHANGED
@@ -8,7 +8,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
8
8
|
describe '#show' do
|
9
9
|
context 'when missing params' do
|
10
10
|
subject { FinApps::REST::Orders.new(client).show(nil) }
|
11
|
-
it
|
11
|
+
it do
|
12
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
13
|
+
end
|
12
14
|
end
|
13
15
|
|
14
16
|
context 'when valid params are provided' do
|
@@ -17,30 +19,38 @@ RSpec.describe FinApps::REST::Orders do
|
|
17
19
|
it { expect { subject }.not_to raise_error }
|
18
20
|
it('returns an array') { expect(subject).to be_a(Array) }
|
19
21
|
it('performs a get and returns the response') do
|
20
|
-
expect(subject[RESULTS]).to
|
21
|
-
expect(subject[RESULTS]).to
|
22
|
+
expect(subject[RESULTS]).to have_key(:public_id)
|
23
|
+
expect(subject[RESULTS]).to have_key(:consumer_id)
|
24
|
+
end
|
25
|
+
it('returns no error messages') do
|
26
|
+
expect(subject[ERROR_MESSAGES]).to be_empty
|
22
27
|
end
|
23
|
-
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
27
31
|
describe '#create' do
|
28
32
|
context 'when missing params' do
|
29
33
|
subject { FinApps::REST::Orders.new(client).create(nil) }
|
30
|
-
it
|
34
|
+
it do
|
35
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
36
|
+
end
|
31
37
|
end
|
32
38
|
|
33
39
|
context 'when valid params are provided' do
|
34
40
|
subject { FinApps::REST::Orders.new(client).create(valid_params) }
|
35
|
-
let(:valid_params)
|
41
|
+
let(:valid_params) do
|
42
|
+
{ applicant: 'valid', institutions: 'valid', product: 'valid' }
|
43
|
+
end
|
36
44
|
|
37
45
|
it { expect { subject }.not_to raise_error }
|
38
46
|
it('returns an array') { expect(subject).to be_a(Array) }
|
39
47
|
it('performs a post and returns the response') do
|
40
|
-
expect(subject[RESULTS]).to
|
41
|
-
expect(subject[RESULTS]).to
|
48
|
+
expect(subject[RESULTS]).to have_key(:public_id)
|
49
|
+
expect(subject[RESULTS]).to have_key(:consumer_id)
|
50
|
+
end
|
51
|
+
it('returns no error messages') do
|
52
|
+
expect(subject[ERROR_MESSAGES]).to be_empty
|
42
53
|
end
|
43
|
-
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
|
44
54
|
end
|
45
55
|
|
46
56
|
context 'when invalid params are provided' do
|
@@ -50,7 +60,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
50
60
|
it { expect { subject }.not_to raise_error }
|
51
61
|
it('results is nil') { expect(subject[RESULTS]).to be_nil }
|
52
62
|
it('error messages array is populated') do
|
53
|
-
expect(subject[ERROR_MESSAGES].first.downcase).to eq(
|
63
|
+
expect(subject[ERROR_MESSAGES].first.downcase).to eq(
|
64
|
+
'invalid request body'
|
65
|
+
)
|
54
66
|
end
|
55
67
|
end
|
56
68
|
end
|
@@ -63,51 +75,73 @@ RSpec.describe FinApps::REST::Orders do
|
|
63
75
|
it { expect { subject }.not_to raise_error }
|
64
76
|
|
65
77
|
it('returns an array') { expect(subject).to be_a(Array) }
|
66
|
-
it('performs a get and returns the response')
|
67
|
-
|
78
|
+
it('performs a get and returns the response') do
|
79
|
+
expect(subject[RESULTS]).to have_key(:orders)
|
80
|
+
end
|
81
|
+
it('returns no error messages') do
|
82
|
+
expect(subject[ERROR_MESSAGES]).to be_empty
|
83
|
+
end
|
68
84
|
end
|
69
85
|
|
70
86
|
context 'when invalid params are provided' do
|
71
87
|
subject { FinApps::REST::Orders.new(client).list(invalid_params) }
|
72
88
|
let(:invalid_params) { %w[this is an array] }
|
73
89
|
|
74
|
-
it
|
90
|
+
it do
|
91
|
+
expect { subject }.to raise_error(FinAppsCore::InvalidArgumentsError)
|
92
|
+
end
|
75
93
|
end
|
76
94
|
|
77
95
|
context 'when including valid params' do
|
78
96
|
subject { FinApps::REST::Orders.new(client).list(params) }
|
79
97
|
let(:params) do
|
80
|
-
{
|
81
|
-
|
98
|
+
{
|
99
|
+
page: 2,
|
100
|
+
sort: 'status',
|
101
|
+
requested: 25,
|
102
|
+
searchTerm: 'term',
|
103
|
+
status: %w[1 7],
|
104
|
+
assignment: 'valid_operator',
|
105
|
+
relation: %w[valid_order_id]
|
106
|
+
}
|
82
107
|
end
|
83
108
|
|
84
109
|
it { expect { subject }.not_to raise_error }
|
85
110
|
it('returns an array') { expect(subject).to be_a(Array) }
|
86
|
-
it('performs a get and returns the response')
|
87
|
-
|
88
|
-
|
111
|
+
it('performs a get and returns the response') do
|
112
|
+
expect(subject[RESULTS]).to have_key(:orders)
|
113
|
+
end
|
114
|
+
it('each order contains a consumer_id') do
|
115
|
+
expect(subject[RESULTS][:orders]).to all(have_key(:consumer_id))
|
116
|
+
end
|
117
|
+
it('returns no error messages') do
|
118
|
+
expect(subject[ERROR_MESSAGES]).to be_empty
|
119
|
+
end
|
89
120
|
it 'builds query and sends proper request' do
|
90
121
|
subject
|
91
|
-
url =
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
122
|
+
url =
|
123
|
+
"#{versioned_api_path}/orders?filter=%7B%22$or%22:%5B%7B%22public_id%22:" \
|
124
|
+
'%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.last_name%22:%22term%22%7D' \
|
125
|
+
',%7B%22assignment.last_name%22:%22term%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5E' \
|
126
|
+
'term%22,%22$options%22:%22i%22%7D%7D%5D,%22status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.' \
|
127
|
+
'operator_id%22:%22valid_operator%22%7D&page=2&requested=25&sort=status'
|
96
128
|
expect(WebMock).to have_requested(:get, url)
|
97
129
|
end
|
98
130
|
it 'builds query and sends proper request with searchTerm/relation exclusivity' do
|
99
131
|
params[:searchTerm] = nil
|
100
132
|
subject
|
101
|
-
url =
|
102
|
-
|
103
|
-
|
104
|
-
|
133
|
+
url =
|
134
|
+
"#{versioned_api_path}/orders?filter=%7B%22status%22:%7B%22$in%22:%5B1," \
|
135
|
+
'7%5D%7D,%22assignment.operator_id%22:%22valid_operator%22,%22$or%22:%5B%7B%22public_id%22:%7B%22$in' \
|
136
|
+
'%22:%5B%22valid_order_id%22%5D%7D%7D,%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22' \
|
137
|
+
'%5D%7D%7D%5D%7D&page=2&requested=25&sort=status'
|
105
138
|
expect(WebMock).to have_requested(:get, url)
|
106
139
|
end
|
107
140
|
it 'builds null assignment query properly when supplied w/ empty string' do
|
108
141
|
FinApps::REST::Orders.new(client).list(assignment: '')
|
109
142
|
|
110
|
-
url =
|
143
|
+
url =
|
144
|
+
"#{versioned_api_path}/orders?filter=%7B%22assignment.operator_id%22:null%7D"
|
111
145
|
expect(WebMock).to have_requested(:get, url)
|
112
146
|
end
|
113
147
|
end
|
@@ -118,12 +152,16 @@ RSpec.describe FinApps::REST::Orders do
|
|
118
152
|
|
119
153
|
context 'when missing id' do
|
120
154
|
let(:update) { subject.update(nil, :params) }
|
121
|
-
it('returns missing argument error')
|
155
|
+
it('returns missing argument error') do
|
156
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
157
|
+
end
|
122
158
|
end
|
123
159
|
|
124
160
|
context 'when missing params' do
|
125
161
|
let(:update) { subject.update(:id, nil) }
|
126
|
-
it('returns missing argument error')
|
162
|
+
it('returns missing argument error') do
|
163
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
164
|
+
end
|
127
165
|
end
|
128
166
|
|
129
167
|
context 'when valid id and params are provided' do
|
@@ -143,7 +181,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
143
181
|
|
144
182
|
it { expect { update }.not_to raise_error }
|
145
183
|
it('results is nil') { expect(results).to be_nil }
|
146
|
-
it('error messages array is populated')
|
184
|
+
it('error messages array is populated') do
|
185
|
+
expect(error_messages.first.downcase).to eq('resource not found')
|
186
|
+
end
|
147
187
|
end
|
148
188
|
|
149
189
|
context 'when invalid params are provided' do
|
@@ -153,7 +193,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
153
193
|
|
154
194
|
it { expect { update }.not_to raise_error }
|
155
195
|
it('results is nil') { expect(results).to be_nil }
|
156
|
-
it('error messages array is populated')
|
196
|
+
it('error messages array is populated') do
|
197
|
+
expect(error_messages.first.downcase).to eq('invalid request body')
|
198
|
+
end
|
157
199
|
end
|
158
200
|
end
|
159
201
|
|
@@ -162,7 +204,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
162
204
|
|
163
205
|
context 'when missing id' do
|
164
206
|
let(:destroy) { subject.destroy(nil) }
|
165
|
-
it('returns missing argument error')
|
207
|
+
it('returns missing argument error') do
|
208
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
209
|
+
end
|
166
210
|
end
|
167
211
|
|
168
212
|
context 'when invalid id is provided' do
|
@@ -172,7 +216,9 @@ RSpec.describe FinApps::REST::Orders do
|
|
172
216
|
|
173
217
|
it { expect { destroy }.not_to raise_error }
|
174
218
|
it('results is nil') { expect(results).to be_nil }
|
175
|
-
it('error messages array is populated')
|
219
|
+
it('error messages array is populated') do
|
220
|
+
expect(error_messages.first.downcase).to eq('resource not found')
|
221
|
+
end
|
176
222
|
end
|
177
223
|
|
178
224
|
context 'for valid id' do
|
@@ -6,23 +6,33 @@ RSpec.describe FinApps::REST::PasswordResets do
|
|
6
6
|
describe '#create' do
|
7
7
|
context 'when missing id' do
|
8
8
|
subject { FinApps::REST::PasswordResets.new(client).create(nil) }
|
9
|
-
it
|
9
|
+
it do
|
10
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
|
12
14
|
context 'when invalid id is provided' do
|
13
|
-
subject
|
15
|
+
subject do
|
16
|
+
FinApps::REST::PasswordResets.new(client).create(:invalid_user_id)
|
17
|
+
end
|
14
18
|
|
15
19
|
it { expect { subject }.not_to raise_error }
|
16
20
|
it('results is nil') { expect(subject[0]).to be_nil }
|
17
|
-
it('error messages array is populated')
|
21
|
+
it('error messages array is populated') do
|
22
|
+
expect(subject[1]).not_to be_nil
|
23
|
+
end
|
18
24
|
end
|
19
25
|
|
20
26
|
context 'when valid id is provided' do
|
21
|
-
subject
|
27
|
+
subject do
|
28
|
+
FinApps::REST::PasswordResets.new(client).create(:valid_user_id)
|
29
|
+
end
|
22
30
|
|
23
31
|
it { expect { subject }.not_to raise_error }
|
24
32
|
it('returns an array') { expect(subject).to be_a(Array) }
|
25
|
-
it('performs a post and returns the response')
|
33
|
+
it('performs a post and returns the response') do
|
34
|
+
expect(subject[0]).to have_key(:token)
|
35
|
+
end
|
26
36
|
it('returns no error messages') { expect(subject[1]).to be_empty }
|
27
37
|
end
|
28
38
|
end
|
@@ -33,36 +43,63 @@ RSpec.describe FinApps::REST::PasswordResets do
|
|
33
43
|
|
34
44
|
context 'when missing id' do
|
35
45
|
subject { FinApps::REST::PasswordResets.new(client).update(nil, :params) }
|
36
|
-
it
|
46
|
+
it do
|
47
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
48
|
+
end
|
37
49
|
end
|
38
50
|
|
39
51
|
context 'when missing params' do
|
40
|
-
subject
|
41
|
-
|
52
|
+
subject do
|
53
|
+
FinApps::REST::PasswordResets.new(client).update(:valid_user_id, nil)
|
54
|
+
end
|
55
|
+
it do
|
56
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
57
|
+
end
|
42
58
|
end
|
43
59
|
|
44
60
|
context 'when invalid id is provided' do
|
45
|
-
subject
|
61
|
+
subject do
|
62
|
+
FinApps::REST::PasswordResets.new(client).update(
|
63
|
+
:invalid_user_id,
|
64
|
+
valid_params
|
65
|
+
)
|
66
|
+
end
|
46
67
|
|
47
68
|
it { expect { subject }.not_to raise_error }
|
48
69
|
it('results is nil') { expect(subject[0]).to be_nil }
|
49
|
-
it('error messages array is populated')
|
70
|
+
it('error messages array is populated') do
|
71
|
+
expect(subject[1]).not_to be_nil
|
72
|
+
end
|
50
73
|
end
|
51
74
|
|
52
75
|
context 'when invalid params are provided' do
|
53
|
-
subject
|
76
|
+
subject do
|
77
|
+
FinApps::REST::PasswordResets.new(client).update(
|
78
|
+
:valid_user_id,
|
79
|
+
invalid_params
|
80
|
+
)
|
81
|
+
end
|
54
82
|
|
55
83
|
it { expect { subject }.not_to raise_error }
|
56
84
|
it('results is nil') { expect(subject[0]).to be_nil }
|
57
|
-
it('error messages array is populated')
|
85
|
+
it('error messages array is populated') do
|
86
|
+
expect(subject[1]).not_to be_nil
|
87
|
+
end
|
58
88
|
end
|
59
89
|
|
60
90
|
context 'when valid params are provided' do
|
61
|
-
subject
|
91
|
+
subject do
|
92
|
+
FinApps::REST::PasswordResets.new(client).update(
|
93
|
+
:valid_user_id,
|
94
|
+
valid_params
|
95
|
+
)
|
96
|
+
end
|
62
97
|
|
63
98
|
it { expect { subject }.not_to raise_error }
|
64
99
|
it('returns an array') { expect(subject).to be_a(Array) }
|
65
|
-
it('performs a post and returns the response')
|
100
|
+
it('performs a post and returns the response') do
|
101
|
+
expect(subject[0]).to have_key(:token)
|
102
|
+
end
|
66
103
|
it('returns no error messages') { expect(subject[1]).to be_empty }
|
67
104
|
end
|
68
105
|
end
|
@@ -18,9 +18,11 @@ RSpec.describe FinApps::REST::PlaidWebhooks do
|
|
18
18
|
it_behaves_like 'an API request'
|
19
19
|
|
20
20
|
it('performs a post and returns the webhook url') do
|
21
|
-
expect(create[RESULTS]).to
|
21
|
+
expect(create[RESULTS]).to have_key(:url)
|
22
|
+
end
|
23
|
+
it('returns no error messages') do
|
24
|
+
expect(create[ERROR_MESSAGES]).to be_empty
|
22
25
|
end
|
23
|
-
it('returns no error messages') { expect(create[ERROR_MESSAGES]).to be_empty }
|
24
26
|
end
|
25
27
|
|
26
28
|
context 'when invalid tenant token is provided' do
|
@@ -29,7 +31,9 @@ RSpec.describe FinApps::REST::PlaidWebhooks do
|
|
29
31
|
it_behaves_like 'an API request'
|
30
32
|
it('results is nil') { expect(create[RESULTS]).to be_nil }
|
31
33
|
it('error messages array is populated') do
|
32
|
-
expect(create[ERROR_MESSAGES].first.downcase).to eq(
|
34
|
+
expect(create[ERROR_MESSAGES].first.downcase).to eq(
|
35
|
+
'resource not found'
|
36
|
+
)
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -16,7 +16,9 @@ RSpec.describe FinApps::REST::PortfolioReports 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::PortfolioReports 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/reports?page=2&requested=25&" \
|
44
|
+
'sort=-created_date'
|
40
45
|
expect(WebMock).to have_requested(:get, url)
|
41
46
|
end
|
42
47
|
end
|
@@ -24,8 +24,8 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
|
|
24
24
|
it('returns an array') { expect(list).to be_a(Array) }
|
25
25
|
it('performs a get and returns array of alert definitions') do
|
26
26
|
expect(results).to be_a(Array)
|
27
|
-
expect(results.first).to
|
28
|
-
expect(results.first).to
|
27
|
+
expect(results.first).to have_key(:_id)
|
28
|
+
expect(results.first).to have_key(:rule_name)
|
29
29
|
end
|
30
30
|
it('returns no error messages') { expect(errors).to be_empty }
|
31
31
|
end
|
@@ -50,21 +50,25 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
|
|
50
50
|
let(:portfolio_id) { nil }
|
51
51
|
let(:alert_id) { 'valid_id' }
|
52
52
|
|
53
|
-
it
|
53
|
+
it do
|
54
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
55
|
+
end
|
54
56
|
end
|
55
57
|
|
56
58
|
context 'when missing alert_id' do
|
57
59
|
let(:portfolio_id) { 'valid_id' }
|
58
60
|
let(:alert_id) { nil }
|
59
61
|
|
60
|
-
it
|
62
|
+
it do
|
63
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
64
|
+
end
|
61
65
|
end
|
62
66
|
|
63
67
|
context 'when valid ids are provided' do
|
64
68
|
let(:portfolio_id) { 'valid_id' }
|
65
69
|
let(:alert_id) { portfolio_id }
|
66
70
|
|
67
|
-
it { expect { create }.not_to raise_error
|
71
|
+
it { expect { create }.not_to raise_error }
|
68
72
|
it('returns an array') { expect(create).to be_a(Array) }
|
69
73
|
it('results is nil') { expect(results).to be_nil }
|
70
74
|
it('returns no error messages') { expect(errors).to be_empty }
|
@@ -74,7 +78,7 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
|
|
74
78
|
let(:portfolio_id) { 'invalid_id' }
|
75
79
|
let(:alert_id) { portfolio_id }
|
76
80
|
|
77
|
-
it { expect { create }.not_to raise_error
|
81
|
+
it { expect { create }.not_to raise_error }
|
78
82
|
it('results is nil') { expect(results).to be_nil }
|
79
83
|
it('error messages array is populated') do
|
80
84
|
expect(errors.first.downcase).to eq('resource not found')
|
@@ -91,21 +95,25 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
|
|
91
95
|
let(:portfolio_id) { nil }
|
92
96
|
let(:alert_id) { 'valid_id' }
|
93
97
|
|
94
|
-
it
|
98
|
+
it do
|
99
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
100
|
+
end
|
95
101
|
end
|
96
102
|
|
97
103
|
context 'when missing alert_id' do
|
98
104
|
let(:portfolio_id) { 'valid_id' }
|
99
105
|
let(:alert_id) { nil }
|
100
106
|
|
101
|
-
it
|
107
|
+
it do
|
108
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
109
|
+
end
|
102
110
|
end
|
103
111
|
|
104
112
|
context 'when valid ids are provided' do
|
105
113
|
let(:portfolio_id) { 'valid_id' }
|
106
114
|
let(:alert_id) { portfolio_id }
|
107
115
|
|
108
|
-
it { expect { destroy }.not_to raise_error
|
116
|
+
it { expect { destroy }.not_to raise_error }
|
109
117
|
it('returns an array') { expect(destroy).to be_a(Array) }
|
110
118
|
it('results is nil') { expect(results).to be_nil }
|
111
119
|
it('returns no error messages') { expect(errors).to be_empty }
|
@@ -115,7 +123,7 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
|
|
115
123
|
let(:portfolio_id) { 'invalid_id' }
|
116
124
|
let(:alert_id) { portfolio_id }
|
117
125
|
|
118
|
-
it { expect { destroy }.not_to raise_error
|
126
|
+
it { expect { destroy }.not_to raise_error }
|
119
127
|
it('results is nil') { expect(results).to be_nil }
|
120
128
|
it('error messages array is populated') do
|
121
129
|
expect(errors.first.downcase).to eq('resource not found')
|