finapps 5.0.30 → 5.0.35
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/.github/workflows/main.yaml +37 -0
- data/.rubocop.yml +134 -61
- 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/rest/alert_definitions.rb +1 -1
- data/lib/finapps/rest/alert_occurrences.rb +1 -1
- data/lib/finapps/rest/client.rb +6 -5
- data/lib/finapps/rest/consumers.rb +22 -6
- data/lib/finapps/rest/consumers_portfolios.rb +1 -1
- data/lib/finapps/rest/documents_orders.rb +43 -26
- 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 +240 -192
- data/spec/rest/documents_orders_notifications_spec.rb +4 -2
- data/spec/rest/documents_orders_spec.rb +94 -17
- 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 +9 -3
- data/spec/support/fixtures/documents_orders_none.json +6 -0
- data/spec/utils/query_builder_spec.rb +40 -14
- metadata +20 -17
@@ -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,8 @@ 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) }
|
65
|
-
it
|
66
|
-
|
67
|
-
expect(results).to have_key(:product)
|
68
|
-
end
|
70
|
+
it { expect(results).to have_key(:_id) }
|
71
|
+
it { expect(results).to have_key(:product) }
|
69
72
|
it('returns no error messages') { expect(errors).to be_empty }
|
70
73
|
end
|
71
74
|
|
@@ -74,6 +77,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
74
77
|
|
75
78
|
it { expect { show }.not_to raise_error }
|
76
79
|
it('results is nil') { expect(results).to be_nil }
|
80
|
+
|
77
81
|
it('error messages array is populated') do
|
78
82
|
expect(errors.first.downcase).to eq('resource not found')
|
79
83
|
end
|
@@ -104,10 +108,8 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
104
108
|
|
105
109
|
it { expect { create }.not_to raise_error }
|
106
110
|
it('returns an array') { expect(create).to be_a(Array) }
|
107
|
-
it
|
108
|
-
|
109
|
-
expect(results).to have_key(:product)
|
110
|
-
end
|
111
|
+
it { expect(results).to have_key(:_id) }
|
112
|
+
it { expect(results).to have_key(:product) }
|
111
113
|
it('returns no error messages') { expect(errors).to be_empty }
|
112
114
|
end
|
113
115
|
|
@@ -122,6 +124,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
122
124
|
|
123
125
|
it { expect { create }.not_to raise_error }
|
124
126
|
it('results is nil') { expect(results).to be_nil }
|
127
|
+
|
125
128
|
it('error messages array is populated') do
|
126
129
|
expect(errors.first.downcase).to eq('invalid request body')
|
127
130
|
end
|
@@ -135,7 +138,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
135
138
|
|
136
139
|
context 'when missing id' do
|
137
140
|
let(:id) { nil }
|
138
|
-
let(:params) { {
|
141
|
+
let(:params) { {fake: 'data'} }
|
139
142
|
|
140
143
|
it do
|
141
144
|
expect { update }.to raise_error(FinAppsCore::MissingArgumentsError)
|
@@ -153,10 +156,11 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
153
156
|
|
154
157
|
context 'when invalid id or params are provided' do
|
155
158
|
let(:id) { 'invalid_id' }
|
156
|
-
let(:params) { {
|
159
|
+
let(:params) { {fake: 'data'} }
|
157
160
|
|
158
161
|
it { expect { update }.not_to raise_error }
|
159
162
|
it('results is nil') { expect(results).to be_nil }
|
163
|
+
|
160
164
|
it('error messages array is populated') do
|
161
165
|
expect(errors.first.downcase).to eq('resource not found')
|
162
166
|
end
|
@@ -164,14 +168,12 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
164
168
|
|
165
169
|
context 'when valid id and params are provided' do
|
166
170
|
let(:id) { 'valid_id' }
|
167
|
-
let(:params) { {
|
171
|
+
let(:params) { {fake: 'data'} }
|
168
172
|
|
169
173
|
it { expect { update }.not_to raise_error }
|
170
174
|
it('returns an array') { expect(update).to be_a(Array) }
|
171
|
-
it
|
172
|
-
|
173
|
-
expect(results).to have_key(:product)
|
174
|
-
end
|
175
|
+
it { expect(results).to have_key(:_id) }
|
176
|
+
it { expect(results).to have_key(:product) }
|
175
177
|
it('returns no error messages') { expect(errors).to be_empty }
|
176
178
|
end
|
177
179
|
end
|
@@ -194,6 +196,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
194
196
|
|
195
197
|
it { expect { destroy }.not_to raise_error }
|
196
198
|
it('results is nil') { expect(results).to be_nil }
|
199
|
+
|
197
200
|
it('error messages array is populated') do
|
198
201
|
expect(errors.first.downcase).to eq('resource not found')
|
199
202
|
end
|
data/spec/rest/products_spec.rb
CHANGED
@@ -2,23 +2,26 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::Products
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
RSpec.describe FinApps::REST::Products do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:products) { described_class.new(client) }
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
describe '#list' do
|
11
|
+
context 'when called' do
|
12
|
+
let(:list) { subject.list }
|
13
|
+
let(:results) { list[0] }
|
14
|
+
let(:error_messages) { list[1] }
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
it { expect { list }.not_to raise_error }
|
17
|
+
it('returns an array of records') { expect(results).to be_a(Array) }
|
18
|
+
|
19
|
+
it('performs a get and returns the response') do
|
20
|
+
expect(results[0]).to have_key(:code)
|
21
|
+
end
|
22
|
+
|
23
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
20
24
|
end
|
21
|
-
it('returns no error messages') { expect(error_messages).to be_empty }
|
22
25
|
end
|
23
26
|
end
|
24
27
|
end
|
data/spec/rest/sessions_spec.rb
CHANGED
@@ -2,76 +2,81 @@
|
|
2
2
|
|
3
3
|
require 'spec_helpers/client'
|
4
4
|
|
5
|
-
RSpec.describe FinApps::REST::Sessions
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
describe '#create' do
|
11
|
-
let(:create) { subject.create(credentials) }
|
12
|
-
let(:results) { create[0] }
|
13
|
-
let(:error_messages) { create[1] }
|
14
|
-
|
15
|
-
context 'when missing email or password' do
|
16
|
-
message = 'Invalid argument: params.'
|
17
|
-
it do
|
18
|
-
expect do
|
19
|
-
subject.create(email: nil, password: 'password')
|
20
|
-
end.to raise_error(FinAppsCore::InvalidArgumentsError, message)
|
21
|
-
end
|
22
|
-
it do
|
23
|
-
expect { subject.create(email: 'email', password: nil) }.to raise_error(
|
24
|
-
FinAppsCore::InvalidArgumentsError,
|
25
|
-
message
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
5
|
+
RSpec.describe FinApps::REST::Sessions do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:session) { described_class.new(client) }
|
29
9
|
|
30
|
-
|
31
|
-
let(:credentials)
|
32
|
-
|
33
|
-
|
10
|
+
describe '#create' do
|
11
|
+
let(:create) { session.create(credentials) }
|
12
|
+
let(:results) { create[0] }
|
13
|
+
let(:error_messages) { create[1] }
|
34
14
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
15
|
+
context 'when missing email or password' do
|
16
|
+
message = 'Invalid argument: params.'
|
17
|
+
it do
|
18
|
+
expect do
|
19
|
+
session.create(email: nil, password: 'password')
|
20
|
+
end.to raise_error(FinAppsCore::InvalidArgumentsError, message)
|
21
|
+
end
|
22
|
+
|
23
|
+
it do
|
24
|
+
expect { session.create(email: 'email', password: nil) }.to raise_error(
|
25
|
+
FinAppsCore::InvalidArgumentsError,
|
26
|
+
message
|
27
|
+
)
|
28
|
+
end
|
40
29
|
end
|
41
|
-
end
|
42
30
|
|
43
|
-
|
44
|
-
|
45
|
-
|
31
|
+
context 'with invalid credentials' do
|
32
|
+
let(:credentials) do
|
33
|
+
{email: 'email@domain.com', password: 'invalid_password'}
|
34
|
+
end
|
35
|
+
|
36
|
+
it { expect { create }.not_to raise_error }
|
37
|
+
it('results is nil') { expect(results).to be_nil }
|
38
|
+
|
39
|
+
error_message = 'Invalid Consumer Identifier or Credentials'
|
40
|
+
it('error_messages are populated') do
|
41
|
+
expect(error_messages.first).to eq(error_message)
|
42
|
+
end
|
46
43
|
end
|
47
44
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
context 'with valid credentials' do
|
46
|
+
let(:credentials) do
|
47
|
+
{email: 'email@domain.com', password: 'valid_password'}
|
48
|
+
end
|
52
49
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
{ email: 'email@domain.com', password: 'valid_password' }
|
50
|
+
it('results is a Hash') { expect(results).to be_a(Hash) }
|
51
|
+
it('token value is in the result') { expect(results).to have_key(:token) }
|
52
|
+
it('error_messages is empty') { expect(error_messages).to be_empty }
|
57
53
|
end
|
58
54
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
context 'with valid credentials & path argument' do
|
56
|
+
let(:create) { subject.create(credentials, 'operators/login') }
|
57
|
+
let(:credentials) do
|
58
|
+
{email: 'email@domain.com', password: 'valid_password'}
|
59
|
+
end
|
60
|
+
|
61
|
+
it('results is a Hash') { expect(results).to be_a(Hash) }
|
62
|
+
it('token value is in the result') { expect(results).to have_key(:token) }
|
63
|
+
|
64
|
+
it('returns operator for operator path') do
|
65
|
+
expect(results).to have_key(:role)
|
66
|
+
end
|
67
|
+
|
68
|
+
it('error_messages is empty') { expect(error_messages).to be_empty }
|
63
69
|
end
|
64
|
-
it('error_messages is empty') { expect(error_messages).to be_empty }
|
65
70
|
end
|
66
|
-
end
|
67
71
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
describe '#destroy' do
|
73
|
+
let(:destroy) { subject.destroy }
|
74
|
+
let(:results) { destroy[0] }
|
75
|
+
let(:error_messages) { destroy[1] }
|
72
76
|
|
73
|
-
|
74
|
-
|
75
|
-
|
77
|
+
it { expect { destroy }.not_to raise_error }
|
78
|
+
it('results is nil') { expect(results).to be_nil }
|
79
|
+
it('error_messages array is empty') { expect(error_messages).to eq([]) }
|
80
|
+
end
|
76
81
|
end
|
77
82
|
end
|
@@ -7,18 +7,22 @@ RSpec.describe FinApps::REST::SignedDocumentsDownloads 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
|
-
context 'when missing
|
14
|
-
subject { document.show(
|
13
|
+
context 'when missing signature request id' do
|
14
|
+
subject(:show) { document.show(:consumer_id, nil) }
|
15
|
+
|
15
16
|
it 'raises an error when missing consumer id' do
|
16
|
-
expect {
|
17
|
+
expect { show }.to raise_error(FinAppsCore::MissingArgumentsError)
|
17
18
|
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when missing consumer id' do
|
22
|
+
subject(:show) { document.show(nil, :signature_request_id) }
|
18
23
|
|
19
|
-
subject { document.show(:consumer_id, nil) }
|
20
24
|
it 'raises an error when missing signature request id' do
|
21
|
-
expect {
|
25
|
+
expect { show }.to raise_error(FinAppsCore::MissingArgumentsError)
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
@@ -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
|
-
subject { document.list(nil) }
|
14
|
+
subject(:list) { document.list(nil) }
|
15
|
+
|
15
16
|
it 'raises an error when missing record id' do
|
16
|
-
expect {
|
17
|
+
expect { list }.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
|