finapps 5.0.28 → 5.0.33
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/.rubocop.yml +134 -61
- data/.rubocop_todo.yml +120 -0
- data/.tmuxinator.yml +1 -0
- data/.travis.yml +3 -1
- data/RELEASES.md +42 -0
- data/finapps.gemspec +3 -3
- data/lib/finapps.rb +4 -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 +12 -8
- data/lib/finapps/rest/consumers.rb +22 -6
- data/lib/finapps/rest/consumers_portfolios.rb +1 -1
- data/lib/finapps/rest/documents_orders.rb +105 -0
- data/lib/finapps/rest/documents_orders_notifications.rb +14 -0
- data/lib/finapps/rest/esign_templates.rb +11 -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 +349 -0
- data/spec/rest/esign_templates_spec.rb +21 -0
- 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 +64 -1
- data/spec/support/fixtures/documents_order.json +75 -0
- data/spec/support/fixtures/documents_orders.json +32 -0
- data/spec/support/fixtures/documents_orders_none.json +6 -0
- data/spec/support/fixtures/esign_templates.json +6 -0
- data/spec/support/fixtures/invalid_order_id.json +5 -0
- data/spec/support/fixtures/invalid_signature_id.json +5 -0
- data/spec/support/fixtures/sign_url.json +4 -0
- data/spec/support/fixtures/signed_document.pdf +0 -0
- data/spec/utils/query_builder_spec.rb +40 -14
- metadata +81 -60
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
|
|
4
4
|
|
5
5
|
RSpec.describe FinApps::REST::Portfolios 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::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
|
+
|
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::Portfolios 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 =
|
@@ -62,10 +67,12 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
62
67
|
|
63
68
|
it { expect { show }.not_to raise_error }
|
64
69
|
it('returns an array') { expect(show).to be_a(Array) }
|
70
|
+
|
65
71
|
it('performs a get and returns the response') do
|
66
72
|
expect(results).to have_key(:_id)
|
67
73
|
expect(results).to have_key(:product)
|
68
74
|
end
|
75
|
+
|
69
76
|
it('returns no error messages') { expect(errors).to be_empty }
|
70
77
|
end
|
71
78
|
|
@@ -74,6 +81,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
74
81
|
|
75
82
|
it { expect { show }.not_to raise_error }
|
76
83
|
it('results is nil') { expect(results).to be_nil }
|
84
|
+
|
77
85
|
it('error messages array is populated') do
|
78
86
|
expect(errors.first.downcase).to eq('resource not found')
|
79
87
|
end
|
@@ -104,10 +112,12 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
104
112
|
|
105
113
|
it { expect { create }.not_to raise_error }
|
106
114
|
it('returns an array') { expect(create).to be_a(Array) }
|
115
|
+
|
107
116
|
it('performs a get and returns the response') do
|
108
117
|
expect(results).to have_key(:_id)
|
109
118
|
expect(results).to have_key(:product)
|
110
119
|
end
|
120
|
+
|
111
121
|
it('returns no error messages') { expect(errors).to be_empty }
|
112
122
|
end
|
113
123
|
|
@@ -122,6 +132,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
122
132
|
|
123
133
|
it { expect { create }.not_to raise_error }
|
124
134
|
it('results is nil') { expect(results).to be_nil }
|
135
|
+
|
125
136
|
it('error messages array is populated') do
|
126
137
|
expect(errors.first.downcase).to eq('invalid request body')
|
127
138
|
end
|
@@ -135,7 +146,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
135
146
|
|
136
147
|
context 'when missing id' do
|
137
148
|
let(:id) { nil }
|
138
|
-
let(:params) { {
|
149
|
+
let(:params) { {fake: 'data'} }
|
139
150
|
|
140
151
|
it do
|
141
152
|
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
@@ -153,10 +164,11 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
153
164
|
|
154
165
|
context 'when invalid id or params are provided' do
|
155
166
|
let(:id) { 'invalid_id' }
|
156
|
-
let(:params) { {
|
167
|
+
let(:params) { {fake: 'data'} }
|
157
168
|
|
158
169
|
it { expect { update }.not_to raise_error }
|
159
170
|
it('results is nil') { expect(results).to be_nil }
|
171
|
+
|
160
172
|
it('error messages array is populated') do
|
161
173
|
expect(errors.first.downcase).to eq('resource not found')
|
162
174
|
end
|
@@ -164,14 +176,16 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
164
176
|
|
165
177
|
context 'when valid id and params are provided' do
|
166
178
|
let(:id) { 'valid_id' }
|
167
|
-
let(:params) { {
|
179
|
+
let(:params) { {fake: 'data'} }
|
168
180
|
|
169
181
|
it { expect { update }.not_to raise_error }
|
170
182
|
it('returns an array') { expect(update).to be_a(Array) }
|
183
|
+
|
171
184
|
it('performs a get and returns the response') do
|
172
185
|
expect(results).to have_key(:_id)
|
173
186
|
expect(results).to have_key(:product)
|
174
187
|
end
|
188
|
+
|
175
189
|
it('returns no error messages') { expect(errors).to be_empty }
|
176
190
|
end
|
177
191
|
end
|
@@ -194,6 +208,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
194
208
|
|
195
209
|
it { expect { destroy }.not_to raise_error }
|
196
210
|
it('results is nil') { expect(results).to be_nil }
|
211
|
+
|
197
212
|
it('error messages array is populated') do
|
198
213
|
expect(errors.first.downcase).to eq('resource not found')
|
199
214
|
end
|
data/spec/rest/products_spec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'spec_helpers/client'
|
|
5
5
|
RSpec.describe FinApps::REST::Products,
|
6
6
|
'initialized with valid FinApps::Client object' do
|
7
7
|
include SpecHelpers::Client
|
8
|
-
subject(:products) {
|
8
|
+
subject(:products) { described_class.new(client) }
|
9
9
|
|
10
10
|
describe '#list' do
|
11
11
|
context 'when called' do
|
@@ -15,9 +15,11 @@ RSpec.describe FinApps::REST::Products,
|
|
15
15
|
|
16
16
|
it { expect { list }.not_to raise_error }
|
17
17
|
it('returns an array of records') { expect(results).to be_a(Array) }
|
18
|
+
|
18
19
|
it('performs a get and returns the response') do
|
19
20
|
expect(results[0]).to have_key(:code)
|
20
21
|
end
|
22
|
+
|
21
23
|
it('returns no error messages') { expect(error_messages).to be_empty }
|
22
24
|
end
|
23
25
|
end
|
data/spec/rest/sessions_spec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'spec_helpers/client'
|
|
5
5
|
RSpec.describe FinApps::REST::Sessions,
|
6
6
|
'initialized with valid FinApps::Client object' do
|
7
7
|
include SpecHelpers::Client
|
8
|
-
subject {
|
8
|
+
subject { described_class.new(client) }
|
9
9
|
|
10
10
|
describe '#create' do
|
11
11
|
let(:create) { subject.create(credentials) }
|
@@ -19,6 +19,7 @@ RSpec.describe FinApps::REST::Sessions,
|
|
19
19
|
subject.create(email: nil, password: 'password')
|
20
20
|
end.to raise_error(FinAppsCore::InvalidArgumentsError, message)
|
21
21
|
end
|
22
|
+
|
22
23
|
it do
|
23
24
|
expect { subject.create(email: 'email', password: nil) }.to raise_error(
|
24
25
|
FinAppsCore::InvalidArgumentsError,
|
@@ -29,11 +30,12 @@ RSpec.describe FinApps::REST::Sessions,
|
|
29
30
|
|
30
31
|
context 'for invalid credentials' do
|
31
32
|
let(:credentials) do
|
32
|
-
{
|
33
|
+
{email: 'email@domain.com', password: 'invalid_password'}
|
33
34
|
end
|
34
35
|
|
35
36
|
it { expect { create }.not_to raise_error }
|
36
37
|
it('results is nil') { expect(results).to be_nil }
|
38
|
+
|
37
39
|
error_message = 'Invalid Consumer Identifier or Credentials'
|
38
40
|
it('error_messages are populated') do
|
39
41
|
expect(error_messages.first).to eq(error_message)
|
@@ -42,7 +44,7 @@ RSpec.describe FinApps::REST::Sessions,
|
|
42
44
|
|
43
45
|
context 'for valid credentials' do
|
44
46
|
let(:credentials) do
|
45
|
-
{
|
47
|
+
{email: 'email@domain.com', password: 'valid_password'}
|
46
48
|
end
|
47
49
|
|
48
50
|
it('results is a Hash') { expect(results).to be_a(Hash) }
|
@@ -53,14 +55,16 @@ RSpec.describe FinApps::REST::Sessions,
|
|
53
55
|
context 'for valid credentials & path argument' do
|
54
56
|
let(:create) { subject.create(credentials, 'operators/login') }
|
55
57
|
let(:credentials) do
|
56
|
-
{
|
58
|
+
{email: 'email@domain.com', password: 'valid_password'}
|
57
59
|
end
|
58
60
|
|
59
61
|
it('results is a Hash') { expect(results).to be_a(Hash) }
|
60
62
|
it('token value is in the result') { expect(results).to have_key(:token) }
|
63
|
+
|
61
64
|
it('returns operator for operator path') do
|
62
65
|
expect(results).to have_key(:role)
|
63
66
|
end
|
67
|
+
|
64
68
|
it('error_messages is empty') { expect(error_messages).to be_empty }
|
65
69
|
end
|
66
70
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
require 'rest/api_request'
|
5
|
+
|
6
|
+
RSpec.describe FinApps::REST::SignedDocumentsDownloads do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
|
9
|
+
let(:api_client) { client }
|
10
|
+
let(:document) { described_class.new(api_client) }
|
11
|
+
|
12
|
+
describe '#show' do
|
13
|
+
context 'when missing parameters' do
|
14
|
+
subject { document.show(:consumer_id, nil) }
|
15
|
+
|
16
|
+
it 'raises an error when missing consumer id' do
|
17
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'raises an error when missing signature request id' do
|
21
|
+
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
subject(:show) do
|
26
|
+
document.show(
|
27
|
+
:consumer_id,
|
28
|
+
:signature_request_id
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'an API request'
|
33
|
+
it_behaves_like 'a successful request'
|
34
|
+
end
|
35
|
+
end
|
@@ -4,15 +4,17 @@ require 'spec_helpers/client'
|
|
4
4
|
|
5
5
|
RSpec.describe FinApps::REST::TenantAppSettings do
|
6
6
|
include SpecHelpers::Client
|
7
|
-
subject {
|
7
|
+
subject { described_class.new(client) }
|
8
8
|
|
9
9
|
describe '#show' do
|
10
10
|
let(:show) { subject.show }
|
11
11
|
|
12
12
|
it { expect { show }.not_to raise_error }
|
13
|
+
|
13
14
|
it('performs a get and returns the response') do
|
14
15
|
expect(show[RESULTS]).to have_key(:pdf_statement_months)
|
15
16
|
end
|
17
|
+
|
16
18
|
it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
|
17
19
|
end
|
18
20
|
|
@@ -21,28 +23,32 @@ RSpec.describe FinApps::REST::TenantAppSettings do
|
|
21
23
|
|
22
24
|
context 'when missing params' do
|
23
25
|
let(:params) { nil }
|
26
|
+
|
24
27
|
it do
|
25
28
|
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
29
32
|
context 'when valid params are provided' do
|
30
|
-
let(:params) { {
|
33
|
+
let(:params) { {pdf_statement_months: 2} }
|
31
34
|
|
32
35
|
it { expect { update }.not_to raise_error }
|
36
|
+
|
33
37
|
it('performs put and returns no content') do
|
34
38
|
expect(update[RESULTS]).to be_nil
|
35
39
|
end
|
40
|
+
|
36
41
|
it('error_messages array is empty') do
|
37
42
|
expect(update[ERROR_MESSAGES]).to be_empty
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
41
46
|
context 'when invalid params are provided' do
|
42
|
-
let(:params) { {
|
47
|
+
let(:params) { {pdf_statement_months: nil} }
|
43
48
|
|
44
49
|
it { expect { update }.not_to raise_error }
|
45
50
|
it('results is nil') { expect(update[RESULTS]).to be_nil }
|
51
|
+
|
46
52
|
it('error_messages array is populated') do
|
47
53
|
expect(update[ERROR_MESSAGES]).not_to be_empty
|
48
54
|
end
|
@@ -4,15 +4,17 @@ require 'spec_helpers/client'
|
|
4
4
|
|
5
5
|
RSpec.describe FinApps::REST::TenantSettings do
|
6
6
|
include SpecHelpers::Client
|
7
|
-
subject {
|
7
|
+
subject { described_class.new(client) }
|
8
8
|
|
9
9
|
describe '#show' do
|
10
10
|
let(:show) { subject.show }
|
11
11
|
|
12
12
|
it { expect { show }.not_to raise_error }
|
13
|
+
|
13
14
|
it('performs a get and returns the response') do
|
14
15
|
expect(show[RESULTS]).to have_key(:iav_default_product)
|
15
16
|
end
|
17
|
+
|
16
18
|
it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
|
17
19
|
end
|
18
20
|
|
@@ -21,28 +23,32 @@ RSpec.describe FinApps::REST::TenantSettings do
|
|
21
23
|
|
22
24
|
context 'when missing params' do
|
23
25
|
let(:params) { nil }
|
26
|
+
|
24
27
|
it do
|
25
28
|
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
29
32
|
context 'when valid params are provided' do
|
30
|
-
let(:params) { {
|
33
|
+
let(:params) { {iav_default_product: 'valid'} }
|
31
34
|
|
32
35
|
it { expect { update }.not_to raise_error }
|
36
|
+
|
33
37
|
it('performs put and returns no content') do
|
34
38
|
expect(update[RESULTS]).to be_nil
|
35
39
|
end
|
40
|
+
|
36
41
|
it('error_messages array is empty') do
|
37
42
|
expect(update[ERROR_MESSAGES]).to be_empty
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
41
46
|
context 'when invalid params are provided' do
|
42
|
-
let(:params) { {
|
47
|
+
let(:params) { {bad_params: true} }
|
43
48
|
|
44
49
|
it { expect { update }.not_to raise_error }
|
45
50
|
it('results is nil') { expect(update[RESULTS]).to be_nil }
|
51
|
+
|
46
52
|
it('error_messages array is populated') do
|
47
53
|
expect(update[ERROR_MESSAGES]).not_to be_empty
|
48
54
|
end
|
@@ -7,45 +7,38 @@ RSpec.describe FinApps::REST::VerixDocuments do
|
|
7
7
|
include SpecHelpers::Client
|
8
8
|
|
9
9
|
let(:api_client) { client }
|
10
|
-
let(:document) {
|
10
|
+
let(:document) { described_class.new(api_client) }
|
11
11
|
|
12
12
|
describe '#list' do
|
13
13
|
context 'when missing parameters' do
|
14
14
|
subject { document.list(nil) }
|
15
|
+
|
15
16
|
it 'raises an error when missing record id' do
|
16
17
|
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
|
-
subject(:
|
21
|
-
|
22
|
-
:record_id
|
23
|
-
)
|
24
|
-
end
|
21
|
+
subject { document.list(:record_id) }
|
22
|
+
|
25
23
|
it_behaves_like 'an API request'
|
26
24
|
it_behaves_like 'a successful request'
|
27
25
|
end
|
28
26
|
|
29
27
|
describe '#show' do
|
30
|
-
context 'when missing
|
31
|
-
subject { document.show(nil, :document_id) }
|
32
|
-
it 'raises an error when missing record id' do
|
33
|
-
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
34
|
-
end
|
28
|
+
context 'when missing record_id' do
|
29
|
+
subject(:show) { document.show(nil, :document_id) }
|
35
30
|
|
36
|
-
|
37
|
-
it 'raises an error when missing document id' do
|
38
|
-
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
39
|
-
end
|
31
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
40
32
|
end
|
41
33
|
|
42
|
-
|
43
|
-
document.show(
|
44
|
-
|
45
|
-
|
46
|
-
)
|
34
|
+
context 'when missing document_id' do
|
35
|
+
subject(:show) { document.show(:record_id, nil) }
|
36
|
+
|
37
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
47
38
|
end
|
48
39
|
|
40
|
+
subject { document.show(:record_id, :document_id) }
|
41
|
+
|
49
42
|
it_behaves_like 'an API request'
|
50
43
|
it_behaves_like 'a successful request'
|
51
44
|
end
|
@@ -10,7 +10,7 @@ RSpec.describe FinApps::REST::VerixMetadata do
|
|
10
10
|
let(:api_client) { client }
|
11
11
|
|
12
12
|
describe '#show' do
|
13
|
-
subject(:show) {
|
13
|
+
subject(:show) { described_class.new(api_client).show }
|
14
14
|
|
15
15
|
it_behaves_like 'an API request'
|
16
16
|
it_behaves_like 'a successful request'
|
@@ -7,29 +7,24 @@ RSpec.describe FinApps::REST::VerixPdfDocuments do
|
|
7
7
|
include SpecHelpers::Client
|
8
8
|
|
9
9
|
let(:api_client) { client }
|
10
|
-
let(:document) {
|
10
|
+
let(:document) { described_class.new(api_client) }
|
11
11
|
|
12
12
|
describe '#show' do
|
13
|
-
|
14
|
-
subject { document.show(nil, :provider_id) }
|
15
|
-
it 'raises an error when missing record id' do
|
16
|
-
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
17
|
-
end
|
18
|
-
|
19
|
-
subject { document.show(:record_id, nil) }
|
20
|
-
it 'raises an error when missing provider id' do
|
21
|
-
expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
subject(:show) do
|
26
|
-
document.show(
|
27
|
-
:record_id,
|
28
|
-
:provider_id
|
29
|
-
)
|
30
|
-
end
|
13
|
+
subject { document.show(:record_id, :provider_id) }
|
31
14
|
|
32
15
|
it_behaves_like 'an API request'
|
33
16
|
it_behaves_like 'a successful request'
|
17
|
+
|
18
|
+
context 'when missing record_id' do
|
19
|
+
subject(:show) { document.show(nil, :provider_id) }
|
20
|
+
|
21
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when missing provider_id' do
|
25
|
+
subject(:show) { document.show(:record_id, nil) }
|
26
|
+
|
27
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
28
|
+
end
|
34
29
|
end
|
35
30
|
end
|