finapps 5.0.31 → 5.0.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yaml +37 -0
- data/.rubocop.yml +139 -59
- data/.rubocop_todo.yml +29 -0
- data/.tmuxinator.yml +1 -0
- data/.travis.yml +3 -1
- data/README.md +1 -0
- data/RELEASES.md +29 -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 +8 -5
- data/lib/finapps/rest/consumers.rb +10 -5
- data/lib/finapps/rest/consumers_portfolios.rb +1 -1
- data/lib/finapps/rest/documents_orders.rb +30 -26
- data/lib/finapps/rest/documents_upload_types.rb +11 -0
- data/lib/finapps/rest/documents_uploads.rb +23 -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 +33 -22
- 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 +11 -9
- data/lib/finapps/rest/signed_documents_downloads.rb +3 -1
- data/lib/finapps/utils/query_builder.rb +13 -4
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/alert_definitions_spec.rb +10 -6
- data/spec/rest/alert_occurrences_spec.rb +6 -1
- data/spec/rest/api_request.rb +1 -0
- data/spec/rest/client_spec.rb +33 -41
- data/spec/rest/consumers_portfolios_spec.rb +7 -2
- data/spec/rest/consumers_spec.rb +236 -207
- data/spec/rest/documents_orders_notifications_spec.rb +4 -2
- data/spec/rest/documents_orders_spec.rb +85 -23
- data/spec/rest/documents_upload_types_spec.rb +21 -0
- data/spec/rest/documents_uploads_spec.rb +104 -0
- data/spec/rest/esign_templates_spec.rb +2 -1
- data/spec/rest/operators_password_resets_spec.rb +50 -52
- data/spec/rest/operators_spec.rb +181 -172
- data/spec/rest/order_assignments_spec.rb +6 -1
- data/spec/rest/order_notifications_spec.rb +4 -2
- data/spec/rest/order_refreshes_spec.rb +8 -5
- data/spec/rest/order_reports_spec.rb +21 -15
- data/spec/rest/order_statuses_spec.rb +14 -10
- data/spec/rest/order_tokens_spec.rb +37 -30
- data/spec/rest/orders_spec.rb +121 -73
- data/spec/rest/password_resets_spec.rb +46 -36
- 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 +11 -11
- 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 +9 -4
- data/spec/rest/portfolios_available_consumers_spec.rb +7 -2
- data/spec/rest/portfolios_consumers_spec.rb +15 -4
- data/spec/rest/portfolios_spec.rb +20 -17
- data/spec/rest/products_spec.rb +17 -14
- data/spec/rest/sessions_spec.rb +63 -58
- data/spec/rest/signed_documents_downloads_spec.rb +10 -6
- 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 +15 -22
- 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 +6 -4
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fake_api.rb +24 -3
- data/spec/support/fixtures/documents_orders_none.json +6 -0
- data/spec/support/fixtures/upload_types.json +9 -0
- data/spec/utils/query_builder_spec.rb +40 -14
- metadata +26 -16
@@ -5,7 +5,8 @@ require 'rest/api_request'
|
|
5
5
|
|
6
6
|
RSpec.describe FinApps::REST::EsignTemplates do
|
7
7
|
include SpecHelpers::Client
|
8
|
-
subject(:templates) {
|
8
|
+
subject(:templates) { described_class.new(client).list }
|
9
|
+
|
9
10
|
let(:results) { templates[0] }
|
10
11
|
|
11
12
|
describe '#list' do
|
@@ -2,79 +2,77 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::OperatorsPasswordResets
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
RSpec.describe FinApps::REST::OperatorsPasswordResets do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:operators_password_resets) do
|
9
|
+
described_class.new(client)
|
10
|
+
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
describe '#create' do
|
13
|
+
let(:results) { create[0] }
|
14
|
+
let(:error_messages) { create[1] }
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
context 'when missing params' do
|
17
|
+
let(:create) { subject.create(nil) }
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
it do
|
20
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
21
|
+
end
|
21
22
|
end
|
22
|
-
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
context 'with invalid params' do
|
25
|
+
let(:create) { subject.create(params: 'invalid params') }
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
it do
|
28
|
+
expect { create }.to raise_error(FinAppsCore::InvalidArgumentsError)
|
29
|
+
end
|
29
30
|
end
|
30
|
-
end
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
context 'with valid params' do
|
33
|
+
let(:create) { subject.create(email: 'valid email') }
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
expect(results).to have_key(:
|
39
|
-
expect(results).to have_key(:
|
40
|
-
expect(
|
35
|
+
it { expect { create }.not_to raise_error }
|
36
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
37
|
+
it { expect(results).to have_key(:public_id) }
|
38
|
+
it { expect(results).to have_key(:token) }
|
39
|
+
it { expect(results).to have_key(:expiry_date) }
|
40
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
41
41
|
end
|
42
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
43
42
|
end
|
44
|
-
end
|
45
43
|
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
describe '#update' do
|
45
|
+
let(:results) { update[0] }
|
46
|
+
let(:error_messages) { update[1] }
|
49
47
|
|
50
|
-
|
51
|
-
|
48
|
+
context 'when missing params' do
|
49
|
+
let(:update) { subject.update(nil) }
|
52
50
|
|
53
|
-
|
54
|
-
|
51
|
+
it do
|
52
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
53
|
+
end
|
55
54
|
end
|
56
|
-
end
|
57
55
|
|
58
|
-
|
59
|
-
|
56
|
+
context 'with invalid params' do
|
57
|
+
let(:update) { subject.update(params: 'invalid') }
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
it { expect { update }.not_to raise_error }
|
60
|
+
it('results is nil') { expect(results).to be_nil }
|
61
|
+
|
62
|
+
it('error messages array is populated') do
|
63
|
+
expect(error_messages.first.downcase).to eq('invalid request body')
|
64
|
+
end
|
65
65
|
end
|
66
|
-
end
|
67
66
|
|
68
|
-
|
69
|
-
|
67
|
+
context 'with valid params' do
|
68
|
+
let(:update) { subject.update(params: 'valid') }
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
expect(results).to have_key(:
|
75
|
-
expect(
|
70
|
+
it { expect { update }.not_to raise_error }
|
71
|
+
it('returns an array') { expect(update).to be_a(Array) }
|
72
|
+
it { expect(results).to have_key(:public_id) }
|
73
|
+
it { expect(results).to have_key(:role) }
|
74
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
76
75
|
end
|
77
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
78
76
|
end
|
79
77
|
end
|
80
78
|
end
|
data/spec/rest/operators_spec.rb
CHANGED
@@ -2,241 +2,250 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::Operators
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
describe '#list' do
|
11
|
-
let(:list) { subject.list(params) }
|
12
|
-
let(:results) { list[0] }
|
13
|
-
let(:error_messages) { list[1] }
|
14
|
-
|
15
|
-
context 'when missing params' do
|
16
|
-
let(:params) { nil }
|
17
|
-
it { expect { list }.not_to raise_error }
|
18
|
-
it('performs a get and returns the response') do
|
19
|
-
expect(results).to have_key(:records)
|
20
|
-
end
|
21
|
-
it('returns an array of records') do
|
22
|
-
expect(results[:records]).to be_a(Array)
|
23
|
-
end
|
24
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
25
|
-
end
|
5
|
+
RSpec.describe FinApps::REST::Operators do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:operators) { described_class.new(client) }
|
26
9
|
|
27
|
-
|
28
|
-
let(:
|
10
|
+
describe '#list' do
|
11
|
+
let(:list) { subject.list(params) }
|
12
|
+
let(:results) { list[0] }
|
13
|
+
let(:error_messages) { list[1] }
|
29
14
|
|
30
|
-
|
31
|
-
|
15
|
+
context 'when missing params' do
|
16
|
+
let(:params) { nil }
|
32
17
|
|
33
|
-
|
34
|
-
let(:params) do
|
35
|
-
{
|
36
|
-
page: 2,
|
37
|
-
sort: 'date_created',
|
38
|
-
requested: 25,
|
39
|
-
searchTerm: 'term',
|
40
|
-
role: 2
|
41
|
-
}
|
42
|
-
end
|
18
|
+
it { expect { list }.not_to raise_error }
|
43
19
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
20
|
+
it('performs a get and returns the response') do
|
21
|
+
expect(results).to have_key(:records)
|
22
|
+
end
|
23
|
+
|
24
|
+
it('returns an array of records') do
|
25
|
+
expect(results[:records]).to be_a(Array)
|
26
|
+
end
|
27
|
+
|
28
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
50
29
|
end
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
'%22role%22:2%7D&page=2&requested=25&sort=date_created'
|
57
|
-
expect(WebMock).to have_requested(:get, url)
|
30
|
+
|
31
|
+
context 'when invalid params are provided' do
|
32
|
+
let(:params) { ['invalid array'] }
|
33
|
+
|
34
|
+
it { expect { list }.to raise_error(FinAppsCore::InvalidArgumentsError) }
|
58
35
|
end
|
59
|
-
end
|
60
|
-
end
|
61
36
|
|
62
|
-
|
63
|
-
|
64
|
-
|
37
|
+
context 'when including valid params' do
|
38
|
+
let(:params) do
|
39
|
+
{
|
40
|
+
page: 2,
|
41
|
+
sort: 'date_created',
|
42
|
+
requested: 25,
|
43
|
+
searchTerm: 'term',
|
44
|
+
role: 2
|
45
|
+
}
|
46
|
+
end
|
65
47
|
|
66
|
-
|
67
|
-
let(:show) { subject.show(nil) }
|
48
|
+
it { expect { list }.not_to raise_error }
|
68
49
|
|
69
|
-
|
70
|
-
|
50
|
+
it('performs a get and returns the response') do
|
51
|
+
expect(results).to have_key(:records)
|
52
|
+
end
|
53
|
+
|
54
|
+
it('returns an array of records') do
|
55
|
+
expect(results[:records]).to be_a(Array)
|
56
|
+
end
|
71
57
|
|
72
|
-
|
73
|
-
let(:show) { subject.show(:invalid_id) }
|
58
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
74
59
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
60
|
+
it 'builds query and sends proper request' do
|
61
|
+
list
|
62
|
+
url =
|
63
|
+
"#{versioned_api_path}/operators?filter=%7B%22last_name%22:%22term%22," \
|
64
|
+
'%22role%22:2%7D&page=2&requested=25&sort=date_created'
|
65
|
+
expect(WebMock).to have_requested(:get, url)
|
66
|
+
end
|
79
67
|
end
|
80
68
|
end
|
81
69
|
|
82
|
-
|
83
|
-
let(:
|
70
|
+
describe '#show' do
|
71
|
+
let(:results) { show[0] }
|
72
|
+
let(:error_messages) { show[1] }
|
73
|
+
|
74
|
+
context 'when missing id' do
|
75
|
+
let(:show) { subject.show(nil) }
|
84
76
|
|
85
|
-
|
86
|
-
it('returns an array') { expect(show).to be_a(Array) }
|
87
|
-
it('performs a get and returns the response') do
|
88
|
-
expect(results).to have_key(:public_id)
|
77
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
89
78
|
end
|
90
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
91
|
-
end
|
92
|
-
end
|
93
79
|
|
94
|
-
|
95
|
-
|
96
|
-
let(:error_messages) { create[1] }
|
80
|
+
context 'with invalid id' do
|
81
|
+
let(:show) { subject.show(:invalid_id) }
|
97
82
|
|
98
|
-
|
99
|
-
|
83
|
+
it { expect { show }.not_to raise_error }
|
84
|
+
it('results is nil') { expect(results).to be_nil }
|
100
85
|
|
101
|
-
|
102
|
-
|
86
|
+
it('error messages array is populated') do
|
87
|
+
expect(error_messages.first.downcase).to eq('resource not found')
|
88
|
+
end
|
103
89
|
end
|
104
|
-
end
|
105
90
|
|
106
|
-
|
107
|
-
|
91
|
+
context 'with valid id' do
|
92
|
+
let(:show) { subject.show(:valid_id) }
|
93
|
+
|
94
|
+
it { expect { show }.not_to raise_error }
|
95
|
+
it('returns an array') { expect(show).to be_a(Array) }
|
108
96
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
97
|
+
it('performs a get and returns the response') do
|
98
|
+
expect(results).to have_key(:public_id)
|
99
|
+
end
|
100
|
+
|
101
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
113
102
|
end
|
114
103
|
end
|
115
104
|
|
116
|
-
|
117
|
-
let(:
|
105
|
+
describe '#create' do
|
106
|
+
let(:results) { create[0] }
|
107
|
+
let(:error_messages) { create[1] }
|
108
|
+
|
109
|
+
context 'when missing params' do
|
110
|
+
let(:create) { subject.create(nil) }
|
118
111
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
expect(results).to have_key(:public_id)
|
123
|
-
expect(results).to have_key(:role)
|
112
|
+
it do
|
113
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
114
|
+
end
|
124
115
|
end
|
125
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
126
|
-
end
|
127
|
-
end
|
128
116
|
|
129
|
-
|
130
|
-
|
131
|
-
let(:error_messages) { update[1] }
|
117
|
+
context 'when invalid params are provided' do
|
118
|
+
let(:create) { subject.create(params: 'invalid') }
|
132
119
|
|
133
|
-
|
134
|
-
|
120
|
+
it { expect { create }.not_to raise_error }
|
121
|
+
it('results is nil') { expect(results).to be_nil }
|
135
122
|
|
136
|
-
|
137
|
-
|
123
|
+
it('error messages array is populated') do
|
124
|
+
expect(error_messages.first.downcase).to eq('invalid request body')
|
125
|
+
end
|
138
126
|
end
|
139
|
-
end
|
140
127
|
|
141
|
-
|
142
|
-
|
128
|
+
context 'when valid params are provided' do
|
129
|
+
let(:create) { subject.create(params: 'valid') }
|
143
130
|
|
144
|
-
|
145
|
-
|
131
|
+
it { expect { create }.not_to raise_error }
|
132
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
133
|
+
it { expect(results).to have_key(:public_id) }
|
134
|
+
it { expect(results).to have_key(:role) }
|
135
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
146
136
|
end
|
147
137
|
end
|
148
138
|
|
149
|
-
|
150
|
-
let(:
|
139
|
+
describe '#update' do
|
140
|
+
let(:results) { update[0] }
|
141
|
+
let(:error_messages) { update[1] }
|
151
142
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
143
|
+
context 'when missing id' do
|
144
|
+
let(:update) { subject.update(nil, params: 'params') }
|
145
|
+
|
146
|
+
it do
|
147
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
148
|
+
end
|
156
149
|
end
|
157
|
-
end
|
158
150
|
|
159
|
-
|
160
|
-
|
151
|
+
context 'when missing params' do
|
152
|
+
let(:update) { subject.update(:valid_id, nil) }
|
161
153
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
expect(results).to have_key(:email)
|
166
|
-
expect(results).to have_key(:role)
|
154
|
+
it do
|
155
|
+
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
156
|
+
end
|
167
157
|
end
|
168
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
169
|
-
end
|
170
|
-
end
|
171
158
|
|
172
|
-
|
173
|
-
|
174
|
-
let(:error_messages) { update_password[1] }
|
159
|
+
context 'with invalid params' do
|
160
|
+
let(:update) { subject.update(:invalid_id, params: 'params') }
|
175
161
|
|
176
|
-
|
177
|
-
|
162
|
+
it { expect { update }.not_to raise_error }
|
163
|
+
it('results is nil') { expect(results).to be_nil }
|
178
164
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
)
|
165
|
+
it('error messages array is populated') do
|
166
|
+
expect(error_messages.first.downcase).to eq('resource not found')
|
167
|
+
end
|
183
168
|
end
|
184
|
-
end
|
185
169
|
|
186
|
-
|
187
|
-
|
170
|
+
context 'with valid params' do
|
171
|
+
let(:update) { subject.update(:valid_id, params: 'valid params') }
|
188
172
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
)
|
173
|
+
it { expect { update }.not_to raise_error }
|
174
|
+
it('returns an array') { expect(update).to be_a(Array) }
|
175
|
+
it { expect(results).to have_key(:email) }
|
176
|
+
it { expect(results).to have_key(:role) }
|
177
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
193
178
|
end
|
194
179
|
end
|
195
180
|
|
196
|
-
|
197
|
-
let(:
|
198
|
-
|
181
|
+
describe '#update_password' do
|
182
|
+
let(:results) { update_password[0] }
|
183
|
+
let(:error_messages) { update_password[1] }
|
184
|
+
|
185
|
+
context 'when missing params' do
|
186
|
+
let(:update_password) { subject.update_password(nil) }
|
187
|
+
|
188
|
+
it do
|
189
|
+
expect { update_password }.to raise_error(
|
190
|
+
FinAppsCore::MissingArgumentsError
|
191
|
+
)
|
192
|
+
end
|
199
193
|
end
|
200
|
-
let(:update_password) { subject.update_password(valid_params) }
|
201
194
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
195
|
+
context 'with invalid params' do
|
196
|
+
let(:update_password) { subject.update_password(password: 'invalid') }
|
197
|
+
|
198
|
+
it do
|
199
|
+
expect { update_password }.to raise_error(
|
200
|
+
FinAppsCore::InvalidArgumentsError
|
201
|
+
)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
context 'with valid params' do
|
206
|
+
let(:valid_params) do
|
207
|
+
{password: 'valid password', password_confirm: 'valid_password'}
|
208
|
+
end
|
209
|
+
let(:update_password) { subject.update_password(valid_params) }
|
210
|
+
|
211
|
+
it { expect { update_password }.not_to raise_error }
|
212
|
+
it('returns an array') { expect(update_password).to be_a(Array) }
|
213
|
+
it { expect(results).to have_key(:public_id) }
|
214
|
+
it { expect(results).to have_key(:role) }
|
215
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
207
216
|
end
|
208
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
209
217
|
end
|
210
|
-
end
|
211
218
|
|
212
|
-
|
213
|
-
|
214
|
-
|
219
|
+
describe '#destroy' do
|
220
|
+
let(:results) { destroy[0] }
|
221
|
+
let(:error_messages) { destroy[1] }
|
215
222
|
|
216
|
-
|
217
|
-
|
223
|
+
context 'when missing id' do
|
224
|
+
let(:destroy) { subject.destroy(nil) }
|
218
225
|
|
219
|
-
|
220
|
-
|
226
|
+
it do
|
227
|
+
expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError)
|
228
|
+
end
|
221
229
|
end
|
222
|
-
end
|
223
230
|
|
224
|
-
|
225
|
-
|
231
|
+
context 'with invalid id' do
|
232
|
+
let(:destroy) { subject.destroy(:invalid_id) }
|
233
|
+
|
234
|
+
it { expect { destroy }.not_to raise_error }
|
235
|
+
it('results is nil') { expect(results).to be_nil }
|
226
236
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
expect(error_messages.first.downcase).to eq('resource not found')
|
237
|
+
it('error messages array is populated') do
|
238
|
+
expect(error_messages.first.downcase).to eq('resource not found')
|
239
|
+
end
|
231
240
|
end
|
232
|
-
end
|
233
241
|
|
234
|
-
|
235
|
-
|
242
|
+
context 'with valid id' do
|
243
|
+
let(:destroy) { subject.destroy(:valid_id) }
|
236
244
|
|
237
|
-
|
238
|
-
|
239
|
-
|
245
|
+
it { expect { destroy }.not_to raise_error }
|
246
|
+
it('results is nil') { expect(results).to be_nil }
|
247
|
+
it('error_messages array is empty') { expect(error_messages).to eq([]) }
|
248
|
+
end
|
240
249
|
end
|
241
250
|
end
|
242
251
|
end
|