finapps 5.0.3 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -24,7 +24,9 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
|
|
24
24
|
|
25
25
|
it { expect { list }.not_to raise_error }
|
26
26
|
it('returns an array') { expect(list).to be_a(Array) }
|
27
|
-
it('performs a get and returns the response')
|
27
|
+
it('performs a get and returns the response') do
|
28
|
+
expect(results).to have_key(:records)
|
29
|
+
end
|
28
30
|
it('returns no error messages') { expect(errors).to be_empty }
|
29
31
|
end
|
30
32
|
|
@@ -41,12 +43,15 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
|
|
41
43
|
|
42
44
|
it { expect { list }.not_to raise_error }
|
43
45
|
it('returns an array') { expect(list).to be_a(Array) }
|
44
|
-
it('performs a get and returns the response')
|
46
|
+
it('performs a get and returns the response') do
|
47
|
+
expect(results).to have_key(:records)
|
48
|
+
end
|
45
49
|
it('returns no error messages') { expect(errors).to be_empty }
|
46
50
|
it 'builds query and sends proper request' do
|
47
51
|
list
|
48
|
-
url =
|
49
|
-
|
52
|
+
url =
|
53
|
+
"#{versioned_api_path}/portfolios/#{id}/consumers/available?page=2&" \
|
54
|
+
'requested=25&sort=-created_date'
|
50
55
|
expect(WebMock).to have_requested(:get, url)
|
51
56
|
end
|
52
57
|
end
|
@@ -31,7 +31,9 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
31
31
|
|
32
32
|
it { expect { list }.not_to raise_error }
|
33
33
|
it('returns an array') { expect(list).to be_a(Array) }
|
34
|
-
it('performs a get and returns the response')
|
34
|
+
it('performs a get and returns the response') do
|
35
|
+
expect(results).to have_key(:records)
|
36
|
+
end
|
35
37
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
38
|
end
|
37
39
|
|
@@ -41,12 +43,15 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
41
43
|
|
42
44
|
it { expect { list }.not_to raise_error }
|
43
45
|
it('returns an array') { expect(list).to be_a(Array) }
|
44
|
-
it('performs a get and returns the response')
|
46
|
+
it('performs a get and returns the response') do
|
47
|
+
expect(results).to have_key(:records)
|
48
|
+
end
|
45
49
|
it('returns no error messages') { expect(errors).to be_empty }
|
46
50
|
it 'builds query and sends proper request' do
|
47
51
|
list
|
48
|
-
url =
|
49
|
-
|
52
|
+
url =
|
53
|
+
"#{versioned_api_path}/portfolios/#{portfolio_id}/consumers?page=2&" \
|
54
|
+
'requested=25&sort=-created_date'
|
50
55
|
expect(WebMock).to have_requested(:get, url)
|
51
56
|
end
|
52
57
|
end
|
@@ -72,14 +77,18 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
72
77
|
let(:portfolio_id) { nil }
|
73
78
|
let(:params) { 'valid_id' }
|
74
79
|
|
75
|
-
it
|
80
|
+
it do
|
81
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
82
|
+
end
|
76
83
|
end
|
77
84
|
|
78
85
|
context 'when missing params' do
|
79
86
|
let(:portfolio_id) { 'valid_id' }
|
80
87
|
let(:params) { nil }
|
81
88
|
|
82
|
-
it
|
89
|
+
it do
|
90
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
91
|
+
end
|
83
92
|
end
|
84
93
|
|
85
94
|
context 'for bulk subscribe' do
|
@@ -106,7 +115,9 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
106
115
|
it('results is nil') { expect(results).to be_nil }
|
107
116
|
it('error messages array is populated') do
|
108
117
|
# this will break when client is fixed to expect new array error response
|
109
|
-
expect(errors.first.downcase).to eq(
|
118
|
+
expect(errors.first.downcase).to eq(
|
119
|
+
'the server responded with status 400'
|
120
|
+
)
|
110
121
|
end
|
111
122
|
end
|
112
123
|
end
|
@@ -122,7 +133,8 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
122
133
|
it('returns no error messages') { expect(errors).to be_empty }
|
123
134
|
it('builds correct url') do
|
124
135
|
create
|
125
|
-
url =
|
136
|
+
url =
|
137
|
+
"#{versioned_api_path}/portfolios/#{portfolio_id}/consumers/#{params}"
|
126
138
|
expect(WebMock).to have_requested(:post, url)
|
127
139
|
end
|
128
140
|
end
|
@@ -134,7 +146,9 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
134
146
|
it { expect { create }.not_to raise_error }
|
135
147
|
it('results is nil') { expect(results).to be_nil }
|
136
148
|
it('error messages array is populated') do
|
137
|
-
expect(errors.first.downcase).to eq(
|
149
|
+
expect(errors.first.downcase).to eq(
|
150
|
+
'consumer not eligible, no completed orders.'
|
151
|
+
)
|
138
152
|
end
|
139
153
|
end
|
140
154
|
end
|
@@ -149,14 +163,18 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
149
163
|
let(:portfolio_id) { nil }
|
150
164
|
let(:consumer_id) { 'valid_id' }
|
151
165
|
|
152
|
-
it
|
166
|
+
it do
|
167
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
168
|
+
end
|
153
169
|
end
|
154
170
|
|
155
171
|
context 'when missing consumer_id' do
|
156
172
|
let(:portfolio_id) { 'valid_id' }
|
157
173
|
let(:consumer_id) { nil }
|
158
174
|
|
159
|
-
it
|
175
|
+
it do
|
176
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
177
|
+
end
|
160
178
|
end
|
161
179
|
|
162
180
|
context 'when valid ids are provided' do
|
@@ -16,7 +16,9 @@ RSpec.describe FinApps::REST::Portfolios 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,11 +33,14 @@ RSpec.describe FinApps::REST::Portfolios 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 =
|
42
|
+
url =
|
43
|
+
"#{versioned_api_path}/portfolios?page=2&requested=25&sort=-created_date"
|
39
44
|
expect(WebMock).to have_requested(:get, url)
|
40
45
|
end
|
41
46
|
end
|
@@ -55,11 +60,11 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
55
60
|
context 'when valid id is provided' do
|
56
61
|
let(:id) { 'valid_id' }
|
57
62
|
|
58
|
-
it { expect { show }.not_to raise_error
|
63
|
+
it { expect { show }.not_to raise_error }
|
59
64
|
it('returns an array') { expect(show).to be_a(Array) }
|
60
65
|
it('performs a get and returns the response') do
|
61
|
-
expect(results).to
|
62
|
-
expect(results).to
|
66
|
+
expect(results).to have_key(:_id)
|
67
|
+
expect(results).to have_key(:product)
|
63
68
|
end
|
64
69
|
it('returns no error messages') { expect(errors).to be_empty }
|
65
70
|
end
|
@@ -83,25 +88,39 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
83
88
|
context 'when missing params' do
|
84
89
|
let(:params) { nil }
|
85
90
|
|
86
|
-
it
|
91
|
+
it do
|
92
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
93
|
+
end
|
87
94
|
end
|
88
95
|
|
89
96
|
context 'when valid params are provided' do
|
90
|
-
let(:params)
|
97
|
+
let(:params) do
|
98
|
+
{
|
99
|
+
name: 'Account Checks',
|
100
|
+
description: 'Some Check Stuff',
|
101
|
+
product: 'valid'
|
102
|
+
}
|
103
|
+
end
|
91
104
|
|
92
|
-
it { expect { create }.not_to raise_error
|
105
|
+
it { expect { create }.not_to raise_error }
|
93
106
|
it('returns an array') { expect(create).to be_a(Array) }
|
94
107
|
it('performs a get and returns the response') do
|
95
|
-
expect(results).to
|
96
|
-
expect(results).to
|
108
|
+
expect(results).to have_key(:_id)
|
109
|
+
expect(results).to have_key(:product)
|
97
110
|
end
|
98
111
|
it('returns no error messages') { expect(errors).to be_empty }
|
99
112
|
end
|
100
113
|
|
101
114
|
context 'when invalid params are provided' do
|
102
|
-
let(:params)
|
115
|
+
let(:params) do
|
116
|
+
{
|
117
|
+
name: 'Account Checks',
|
118
|
+
description: 'Some Check Stuff',
|
119
|
+
product: 'invalid'
|
120
|
+
}
|
121
|
+
end
|
103
122
|
|
104
|
-
it { expect { create }.not_to raise_error
|
123
|
+
it { expect { create }.not_to raise_error }
|
105
124
|
it('results is nil') { expect(results).to be_nil }
|
106
125
|
it('error messages array is populated') do
|
107
126
|
expect(errors.first.downcase).to eq('invalid request body')
|
@@ -118,34 +137,40 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
118
137
|
let(:id) { nil }
|
119
138
|
let(:params) { { fake: 'data' } }
|
120
139
|
|
121
|
-
it
|
140
|
+
it do
|
141
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
142
|
+
end
|
122
143
|
end
|
123
144
|
|
124
145
|
context 'when missing params' do
|
125
146
|
let(:id) { 'valid_id' }
|
126
147
|
let(:params) { nil }
|
127
148
|
|
128
|
-
it
|
149
|
+
it do
|
150
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
151
|
+
end
|
129
152
|
end
|
130
153
|
|
131
154
|
context 'when invalid id or params are provided' do
|
132
155
|
let(:id) { 'invalid_id' }
|
133
156
|
let(:params) { { fake: 'data' } }
|
134
157
|
|
135
|
-
it { expect { update }.not_to raise_error
|
158
|
+
it { expect { update }.not_to raise_error }
|
136
159
|
it('results is nil') { expect(results).to be_nil }
|
137
|
-
it('error messages array is populated')
|
160
|
+
it('error messages array is populated') do
|
161
|
+
expect(errors.first.downcase).to eq('resource not found')
|
162
|
+
end
|
138
163
|
end
|
139
164
|
|
140
165
|
context 'when valid id and params are provided' do
|
141
166
|
let(:id) { 'valid_id' }
|
142
167
|
let(:params) { { fake: 'data' } }
|
143
168
|
|
144
|
-
it { expect { update }.not_to raise_error
|
169
|
+
it { expect { update }.not_to raise_error }
|
145
170
|
it('returns an array') { expect(update).to be_a(Array) }
|
146
171
|
it('performs a get and returns the response') do
|
147
|
-
expect(results).to
|
148
|
-
expect(results).to
|
172
|
+
expect(results).to have_key(:_id)
|
173
|
+
expect(results).to have_key(:product)
|
149
174
|
end
|
150
175
|
it('returns no error messages') { expect(errors).to be_empty }
|
151
176
|
end
|
@@ -159,7 +184,9 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
159
184
|
context 'when missing id' do
|
160
185
|
let(:id) { nil }
|
161
186
|
|
162
|
-
it
|
187
|
+
it do
|
188
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
189
|
+
end
|
163
190
|
end
|
164
191
|
|
165
192
|
context 'when invalid id is provided' do
|
@@ -167,7 +194,9 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
167
194
|
|
168
195
|
it { expect { destroy }.not_to raise_error }
|
169
196
|
it('results is nil') { expect(results).to be_nil }
|
170
|
-
it('error messages array is populated')
|
197
|
+
it('error messages array is populated') do
|
198
|
+
expect(errors.first.downcase).to eq('resource not found')
|
199
|
+
end
|
171
200
|
end
|
172
201
|
|
173
202
|
context 'when valid id is provided' do
|
data/spec/rest/products_spec.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::Products,
|
5
|
+
RSpec.describe FinApps::REST::Products,
|
6
|
+
'initialized with valid FinApps::Client object' do
|
6
7
|
include SpecHelpers::Client
|
7
8
|
subject(:products) { FinApps::REST::Products.new(client) }
|
8
9
|
|
@@ -14,7 +15,9 @@ RSpec.describe FinApps::REST::Products, 'initialized with valid FinApps::Client
|
|
14
15
|
|
15
16
|
it { expect { list }.not_to raise_error }
|
16
17
|
it('returns an array of records') { expect(results).to be_a(Array) }
|
17
|
-
it('performs a get and returns the response')
|
18
|
+
it('performs a get and returns the response') do
|
19
|
+
expect(results[0]).to have_key(:code)
|
20
|
+
end
|
18
21
|
it('returns no error messages') { expect(error_messages).to be_empty }
|
19
22
|
end
|
20
23
|
end
|
data/spec/rest/sessions_spec.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::Sessions,
|
5
|
+
RSpec.describe FinApps::REST::Sessions,
|
6
|
+
'initialized with valid FinApps::Client object' do
|
6
7
|
include SpecHelpers::Client
|
7
8
|
subject { FinApps::REST::Sessions.new(client) }
|
8
9
|
|
@@ -14,39 +15,60 @@ RSpec.describe FinApps::REST::Sessions, 'initialized with valid FinApps::Client
|
|
14
15
|
context 'when missing email or password' do
|
15
16
|
message = 'Invalid argument: params.'
|
16
17
|
it do
|
17
|
-
expect
|
18
|
-
.
|
18
|
+
expect do
|
19
|
+
subject.create(email: nil, password: 'password')
|
20
|
+
end.to raise_error(FinAppsCore::InvalidArgumentsError, message)
|
19
21
|
end
|
20
22
|
it do
|
21
|
-
expect { subject.create(email: 'email', password: nil) }
|
22
|
-
|
23
|
+
expect { subject.create(email: 'email', password: nil) }.to raise_error(
|
24
|
+
FinAppsCore::InvalidArgumentsError,
|
25
|
+
message
|
26
|
+
)
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
26
30
|
context 'for invalid credentials' do
|
27
|
-
let(:credentials)
|
31
|
+
let(:credentials) do
|
32
|
+
{ email: 'email@domain.com', password: 'invalid_password' }
|
33
|
+
end
|
28
34
|
|
29
35
|
it { expect { create }.not_to raise_error }
|
30
36
|
it('results is nil') { expect(results).to be_nil }
|
31
37
|
error_message = 'Invalid Consumer Identifier or Credentials'
|
32
|
-
it('error_messages are populated')
|
38
|
+
it('error_messages are populated') do
|
39
|
+
expect(error_messages.first).to eq(error_message)
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
43
|
context 'for valid credentials' do
|
36
|
-
let(:credentials)
|
44
|
+
let(:credentials) do
|
45
|
+
{ email: 'email@domain.com', password: 'valid_password' }
|
46
|
+
end
|
37
47
|
|
38
|
-
it('results is a Hashie::Rash')
|
39
|
-
|
48
|
+
it('results is a Hashie::Rash') do
|
49
|
+
expect(results).to be_a(Hash)
|
50
|
+
end
|
51
|
+
it('token value is in the result') do
|
52
|
+
expect(results).to have_key(:token)
|
53
|
+
end
|
40
54
|
it('error_messages is empty') { expect(error_messages).to be_empty }
|
41
55
|
end
|
42
56
|
|
43
57
|
context 'for valid credentials & path argument' do
|
44
58
|
let(:create) { subject.create(credentials, 'operators/login') }
|
45
|
-
let(:credentials)
|
59
|
+
let(:credentials) do
|
60
|
+
{ email: 'email@domain.com', password: 'valid_password' }
|
61
|
+
end
|
46
62
|
|
47
|
-
it('results is a Hashie::Rash')
|
48
|
-
|
49
|
-
|
63
|
+
it('results is a Hashie::Rash') do
|
64
|
+
expect(results).to be_a(Hash)
|
65
|
+
end
|
66
|
+
it('token value is in the result') do
|
67
|
+
expect(results).to have_key(:token)
|
68
|
+
end
|
69
|
+
it('returns operator for operator path') do
|
70
|
+
expect(results).to have_key(:role)
|
71
|
+
end
|
50
72
|
it('error_messages is empty') { expect(error_messages).to be_empty }
|
51
73
|
end
|
52
74
|
end
|
@@ -21,8 +21,12 @@ RSpec.describe FinApps::REST::Statements do
|
|
21
21
|
let(:show) { subject.show('valid_id', 'valid_id') }
|
22
22
|
it { expect { show }.not_to raise_error }
|
23
23
|
it('returns an array') { expect(show).to be_a(Array) }
|
24
|
-
it('performs a get and returns the response')
|
25
|
-
|
24
|
+
it('performs a get and returns the response') do
|
25
|
+
expect(show[RESULTS]).to have_key(:data)
|
26
|
+
end
|
27
|
+
it('returns no error messages') do
|
28
|
+
expect(show[ERROR_MESSAGES]).to be_empty
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
context 'when invalid ids are provided' do
|
@@ -11,7 +11,7 @@ RSpec.describe FinApps::REST::TenantAppSettings do
|
|
11
11
|
|
12
12
|
it { expect { show }.not_to raise_error }
|
13
13
|
it('performs a get and returns the response') do
|
14
|
-
expect(show[RESULTS]).to
|
14
|
+
expect(show[RESULTS]).to have_key(:pdf_statement_months)
|
15
15
|
end
|
16
16
|
it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
|
17
17
|
end
|
@@ -21,15 +21,21 @@ RSpec.describe FinApps::REST::TenantAppSettings do
|
|
21
21
|
|
22
22
|
context 'when missing params' do
|
23
23
|
let(:params) { nil }
|
24
|
-
it
|
24
|
+
it do
|
25
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
27
29
|
context 'when valid params are provided' do
|
28
30
|
let(:params) { { pdf_statement_months: 2 } }
|
29
31
|
|
30
32
|
it { expect { update }.not_to raise_error }
|
31
|
-
it('performs put and returns no content')
|
32
|
-
|
33
|
+
it('performs put and returns no content') do
|
34
|
+
expect(update[RESULTS]).to be_nil
|
35
|
+
end
|
36
|
+
it('error_messages array is empty') do
|
37
|
+
expect(update[ERROR_MESSAGES]).to be_empty
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
context 'when invalid params are provided' do
|
@@ -37,7 +43,9 @@ RSpec.describe FinApps::REST::TenantAppSettings do
|
|
37
43
|
|
38
44
|
it { expect { update }.not_to raise_error }
|
39
45
|
it('results is nil') { expect(update[RESULTS]).to be_nil }
|
40
|
-
it('error_messages array is populated')
|
46
|
+
it('error_messages array is populated') do
|
47
|
+
expect(update[ERROR_MESSAGES]).not_to be_empty
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|