finapps 5.0.32 → 5.0.33

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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +134 -61
  3. data/.rubocop_todo.yml +120 -0
  4. data/.tmuxinator.yml +1 -0
  5. data/.travis.yml +3 -1
  6. data/finapps.gemspec +3 -3
  7. data/lib/finapps/rest/alert_definitions.rb +1 -1
  8. data/lib/finapps/rest/alert_occurrences.rb +1 -1
  9. data/lib/finapps/rest/consumers.rb +5 -5
  10. data/lib/finapps/rest/consumers_portfolios.rb +1 -1
  11. data/lib/finapps/rest/documents_orders.rb +25 -24
  12. data/lib/finapps/rest/operators.rb +5 -5
  13. data/lib/finapps/rest/operators_password_resets.rb +1 -1
  14. data/lib/finapps/rest/order_assignments.rb +1 -1
  15. data/lib/finapps/rest/order_reports.rb +1 -1
  16. data/lib/finapps/rest/orders.rb +10 -10
  17. data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +1 -1
  18. data/lib/finapps/rest/portfolio_reports.rb +1 -1
  19. data/lib/finapps/rest/portfolios.rb +1 -1
  20. data/lib/finapps/rest/portfolios_available_consumers.rb +1 -1
  21. data/lib/finapps/rest/portfolios_consumers.rb +1 -1
  22. data/lib/finapps/rest/sessions.rb +1 -1
  23. data/lib/finapps/rest/signed_documents_downloads.rb +3 -1
  24. data/lib/finapps/version.rb +1 -1
  25. data/spec/rest/alert_definitions_spec.rb +10 -2
  26. data/spec/rest/alert_occurrences_spec.rb +6 -1
  27. data/spec/rest/api_request.rb +1 -0
  28. data/spec/rest/client_spec.rb +2 -2
  29. data/spec/rest/consumers_portfolios_spec.rb +7 -2
  30. data/spec/rest/consumers_spec.rb +39 -11
  31. data/spec/rest/documents_orders_notifications_spec.rb +3 -1
  32. data/spec/rest/documents_orders_spec.rb +85 -23
  33. data/spec/rest/esign_templates_spec.rb +2 -1
  34. data/spec/rest/operators_password_resets_spec.rb +6 -1
  35. data/spec/rest/operators_spec.rb +22 -2
  36. data/spec/rest/order_assignments_spec.rb +6 -1
  37. data/spec/rest/order_notifications_spec.rb +3 -1
  38. data/spec/rest/order_refreshes_spec.rb +7 -1
  39. data/spec/rest/order_reports_spec.rb +7 -1
  40. data/spec/rest/order_statuses_spec.rb +7 -3
  41. data/spec/rest/order_tokens_spec.rb +7 -1
  42. data/spec/rest/orders_spec.rb +63 -29
  43. data/spec/rest/password_resets_spec.rb +20 -10
  44. data/spec/rest/plaid/plaid_account_permissions_spec.rb +5 -4
  45. data/spec/rest/plaid/plaid_accounts_spec.rb +9 -4
  46. data/spec/rest/plaid/plaid_consumer_institutions_spec.rb +10 -10
  47. data/spec/rest/plaid/plaid_institution_logos_spec.rb +1 -1
  48. data/spec/rest/plaid/plaid_webhooks_spec.rb +3 -1
  49. data/spec/rest/portfolio_reports_spec.rb +7 -2
  50. data/spec/rest/portfolios_alerts_spec.rb +6 -1
  51. data/spec/rest/portfolios_available_consumers_spec.rb +7 -2
  52. data/spec/rest/portfolios_consumers_spec.rb +13 -2
  53. data/spec/rest/portfolios_spec.rb +20 -5
  54. data/spec/rest/products_spec.rb +3 -1
  55. data/spec/rest/sessions_spec.rb +8 -4
  56. data/spec/rest/signed_documents_downloads_spec.rb +3 -3
  57. data/spec/rest/tenant_app_settings_spec.rb +9 -3
  58. data/spec/rest/tenant_settings_spec.rb +9 -3
  59. data/spec/rest/verix/verix_documents_spec.rb +13 -20
  60. data/spec/rest/verix/verix_metadata_spec.rb +1 -1
  61. data/spec/rest/verix/verix_pdf_documents_spec.rb +14 -19
  62. data/spec/rest/verix/verix_records_spec.rb +31 -10
  63. data/spec/rest/version_spec.rb +3 -1
  64. data/spec/spec_helper.rb +2 -2
  65. data/spec/support/fake_api.rb +9 -3
  66. data/spec/support/fixtures/documents_orders_none.json +6 -0
  67. data/spec/utils/query_builder_spec.rb +40 -14
  68. metadata +17 -15
@@ -5,7 +5,8 @@ RSpec.describe FinApps::REST::PasswordResets do
5
5
 
6
6
  describe '#create' do
7
7
  context 'when missing id' do
8
- subject { FinApps::REST::PasswordResets.new(client).create(nil) }
8
+ subject { described_class.new(client).create(nil) }
9
+
9
10
  it do
10
11
  expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
11
12
  end
@@ -13,11 +14,12 @@ RSpec.describe FinApps::REST::PasswordResets do
13
14
 
14
15
  context 'when invalid id is provided' do
15
16
  subject do
16
- FinApps::REST::PasswordResets.new(client).create(:invalid_user_id)
17
+ described_class.new(client).create(:invalid_user_id)
17
18
  end
18
19
 
19
20
  it { expect { subject }.not_to raise_error }
20
21
  it('results is nil') { expect(subject[0]).to be_nil }
22
+
21
23
  it('error messages array is populated') do
22
24
  expect(subject[1]).not_to be_nil
23
25
  end
@@ -25,24 +27,27 @@ RSpec.describe FinApps::REST::PasswordResets do
25
27
 
26
28
  context 'when valid id is provided' do
27
29
  subject do
28
- FinApps::REST::PasswordResets.new(client).create(:valid_user_id)
30
+ described_class.new(client).create(:valid_user_id)
29
31
  end
30
32
 
31
33
  it { expect { subject }.not_to raise_error }
32
34
  it('returns an array') { expect(subject).to be_a(Array) }
35
+
33
36
  it('performs a post and returns the response') do
34
37
  expect(subject[0]).to have_key(:token)
35
38
  end
39
+
36
40
  it('returns no error messages') { expect(subject[1]).to be_empty }
37
41
  end
38
42
  end
39
43
 
40
44
  describe '#update' do
41
- let(:valid_params) { { token: 'valid_token' } }
42
- let(:invalid_params) { { token: 'invalid_token' } }
45
+ let(:valid_params) { {token: 'valid_token'} }
46
+ let(:invalid_params) { {token: 'invalid_token'} }
43
47
 
44
48
  context 'when missing id' do
45
- subject { FinApps::REST::PasswordResets.new(client).update(nil, :params) }
49
+ subject { described_class.new(client).update(nil, :params) }
50
+
46
51
  it do
47
52
  expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
48
53
  end
@@ -50,8 +55,9 @@ RSpec.describe FinApps::REST::PasswordResets do
50
55
 
51
56
  context 'when missing params' do
52
57
  subject do
53
- FinApps::REST::PasswordResets.new(client).update(:valid_user_id, nil)
58
+ described_class.new(client).update(:valid_user_id, nil)
54
59
  end
60
+
55
61
  it do
56
62
  expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
57
63
  end
@@ -59,7 +65,7 @@ RSpec.describe FinApps::REST::PasswordResets do
59
65
 
60
66
  context 'when invalid id is provided' do
61
67
  subject do
62
- FinApps::REST::PasswordResets.new(client).update(
68
+ described_class.new(client).update(
63
69
  :invalid_user_id,
64
70
  valid_params
65
71
  )
@@ -67,6 +73,7 @@ RSpec.describe FinApps::REST::PasswordResets do
67
73
 
68
74
  it { expect { subject }.not_to raise_error }
69
75
  it('results is nil') { expect(subject[0]).to be_nil }
76
+
70
77
  it('error messages array is populated') do
71
78
  expect(subject[1]).not_to be_nil
72
79
  end
@@ -74,7 +81,7 @@ RSpec.describe FinApps::REST::PasswordResets do
74
81
 
75
82
  context 'when invalid params are provided' do
76
83
  subject do
77
- FinApps::REST::PasswordResets.new(client).update(
84
+ described_class.new(client).update(
78
85
  :valid_user_id,
79
86
  invalid_params
80
87
  )
@@ -82,6 +89,7 @@ RSpec.describe FinApps::REST::PasswordResets do
82
89
 
83
90
  it { expect { subject }.not_to raise_error }
84
91
  it('results is nil') { expect(subject[0]).to be_nil }
92
+
85
93
  it('error messages array is populated') do
86
94
  expect(subject[1]).not_to be_nil
87
95
  end
@@ -89,7 +97,7 @@ RSpec.describe FinApps::REST::PasswordResets do
89
97
 
90
98
  context 'when valid params are provided' do
91
99
  subject do
92
- FinApps::REST::PasswordResets.new(client).update(
100
+ described_class.new(client).update(
93
101
  :valid_user_id,
94
102
  valid_params
95
103
  )
@@ -97,9 +105,11 @@ RSpec.describe FinApps::REST::PasswordResets do
97
105
 
98
106
  it { expect { subject }.not_to raise_error }
99
107
  it('returns an array') { expect(subject).to be_a(Array) }
108
+
100
109
  it('performs a post and returns the response') do
101
110
  expect(subject[0]).to have_key(:token)
102
111
  end
112
+
103
113
  it('returns no error messages') { expect(subject[1]).to be_empty }
104
114
  end
105
115
  end
@@ -13,6 +13,7 @@ RSpec.describe FinApps::REST::PlaidAccountPermissions do
13
13
  it('returns no content') do
14
14
  expect(subject[RESULTS]).to be_nil
15
15
  end
16
+
16
17
  it('returns no error messages') do
17
18
  expect(subject[ERROR_MESSAGES]).to be_empty
18
19
  end
@@ -20,8 +21,8 @@ RSpec.describe FinApps::REST::PlaidAccountPermissions do
20
21
 
21
22
  describe '#create' do
22
23
  subject(:show) do
23
- FinApps::REST::PlaidAccountPermissions.new(api_client)
24
- .create(:account_id)
24
+ described_class.new(api_client)
25
+ .create(:account_id)
25
26
  end
26
27
 
27
28
  it_behaves_like 'an API request'
@@ -31,8 +32,8 @@ RSpec.describe FinApps::REST::PlaidAccountPermissions do
31
32
 
32
33
  describe '#destroy' do
33
34
  subject(:destroy) do
34
- FinApps::REST::PlaidAccountPermissions.new(api_client)
35
- .destroy(:account_id)
35
+ described_class.new(api_client)
36
+ .destroy(:account_id)
36
37
  end
37
38
 
38
39
  it_behaves_like 'an API request'
@@ -17,7 +17,7 @@ RSpec.describe FinApps::REST::PlaidAccounts do
17
17
 
18
18
  describe '#show' do
19
19
  subject(:show) do
20
- FinApps::REST::PlaidAccounts.new(api_client).show(
20
+ described_class.new(api_client).show(
21
21
  :account_id
22
22
  )
23
23
  end
@@ -28,11 +28,16 @@ RSpec.describe FinApps::REST::PlaidAccounts do
28
28
  end
29
29
 
30
30
  describe '#list' do
31
- subject(:list) { FinApps::REST::PlaidAccounts.new(api_client).list }
31
+ subject(:list) { described_class.new(api_client).list }
32
32
 
33
33
  it_behaves_like 'an API request'
34
34
  it_behaves_like 'a successful request'
35
- it('returns an Array of institution data') { expect(list[RESULTS].first).to have_key(:plaid_institution_id) }
36
- it('returns institution account data') { expect(list[RESULTS].first).to have_key(:accounts) }
35
+ it('returns an Array of institution data') {
36
+ expect(list[RESULTS].first).to have_key(:plaid_institution_id)
37
+ }
38
+
39
+ it('returns institution account data') {
40
+ expect(list[RESULTS].first).to have_key(:accounts)
41
+ }
37
42
  end
38
43
  end
@@ -17,7 +17,7 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
17
17
 
18
18
  describe '#create' do
19
19
  subject(:create) do
20
- FinApps::REST::PlaidConsumerInstitutions.new(api_client).create(
20
+ described_class.new(api_client).create(
21
21
  public_token: 'le-token'
22
22
  )
23
23
  end
@@ -29,7 +29,7 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
29
29
 
30
30
  describe '#show' do
31
31
  subject(:show) do
32
- FinApps::REST::PlaidConsumerInstitutions.new(api_client).show(
32
+ described_class.new(api_client).show(
33
33
  :consumer_institution_id
34
34
  )
35
35
  end
@@ -39,7 +39,7 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
39
39
  it_behaves_like 'a request that returns institution data'
40
40
  context 'when requesting accounts information' do
41
41
  subject(:show) do
42
- FinApps::REST::PlaidConsumerInstitutions.new(api_client).show(
42
+ described_class.new(api_client).show(
43
43
  :consumer_institution_id, show_accounts: true
44
44
  )
45
45
  end
@@ -55,7 +55,7 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
55
55
 
56
56
  describe '#list' do
57
57
  subject(:list) do
58
- FinApps::REST::PlaidConsumerInstitutions.new(api_client).list
58
+ described_class.new(api_client).list
59
59
  end
60
60
 
61
61
  it_behaves_like 'an API request'
@@ -67,8 +67,8 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
67
67
 
68
68
  describe '#destroy' do
69
69
  subject(:destroy) do
70
- FinApps::REST::PlaidConsumerInstitutions.new(api_client)
71
- .destroy(:consumer_institution_id)
70
+ described_class.new(api_client)
71
+ .destroy(:consumer_institution_id)
72
72
  end
73
73
 
74
74
  it_behaves_like 'an API request'
@@ -80,8 +80,8 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
80
80
 
81
81
  describe '#update_status' do
82
82
  subject(:update_status) do
83
- FinApps::REST::PlaidConsumerInstitutions.new(api_client)
84
- .update_status(:consumer_institution_id)
83
+ described_class.new(api_client)
84
+ .update_status(:consumer_institution_id)
85
85
  end
86
86
 
87
87
  it_behaves_like 'an API request'
@@ -91,8 +91,8 @@ RSpec.describe FinApps::REST::PlaidConsumerInstitutions do
91
91
 
92
92
  describe '#public_token' do
93
93
  subject(:public_token) do
94
- FinApps::REST::PlaidConsumerInstitutions.new(api_client)
95
- .public_token(:consumer_institution_id)
94
+ described_class.new(api_client)
95
+ .public_token(:consumer_institution_id)
96
96
  end
97
97
 
98
98
  it_behaves_like 'an API request'
@@ -11,7 +11,7 @@ RSpec.describe FinApps::REST::PlaidInstitutionLogos do
11
11
 
12
12
  describe '#show' do
13
13
  subject(:show) do
14
- FinApps::REST::PlaidInstitutionLogos.new(api_client).show(
14
+ described_class.new(api_client).show(
15
15
  :inst_id
16
16
  )
17
17
  end
@@ -6,8 +6,9 @@ require 'rest/api_request'
6
6
  RSpec.describe FinApps::REST::PlaidWebhooks do
7
7
  include SpecHelpers::Client
8
8
 
9
+ subject(:show) { described_class.new(api_client).show }
10
+
9
11
  let(:api_client) { client }
10
- subject(:show) { FinApps::REST::PlaidWebhooks.new(api_client).show }
11
12
 
12
13
  describe '#show' do
13
14
  context 'when valid tenant token is provided' do
@@ -25,6 +26,7 @@ RSpec.describe FinApps::REST::PlaidWebhooks do
25
26
  it_behaves_like 'an API request'
26
27
 
27
28
  it('results is nil') { expect(show[RESULTS]).to be_nil }
29
+
28
30
  it('error messages array is populated') do
29
31
  expect(show[ERROR_MESSAGES].first.downcase).to eq(
30
32
  'invalid tenant api key or secret'
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
4
4
 
5
5
  RSpec.describe FinApps::REST::PortfolioReports do
6
6
  include SpecHelpers::Client
7
- subject { FinApps::REST::PortfolioReports.new(client) }
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::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
+
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::PortfolioReports do
29
31
  end
30
32
 
31
33
  context 'when including valid params' do
32
- let(:params) { { page: 2, sort: '-created_date', requested: 25 } }
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 =
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
4
4
 
5
5
  RSpec.describe FinApps::REST::PortfoliosAlerts do
6
6
  include SpecHelpers::Client
7
- subject { FinApps::REST::PortfoliosAlerts.new(client) }
7
+ subject { described_class.new(client) }
8
8
 
9
9
  describe '#list' do
10
10
  let(:list) { subject.list(id) }
@@ -22,11 +22,13 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
22
22
 
23
23
  it { expect { list }.not_to raise_error }
24
24
  it('returns an array') { expect(list).to be_a(Array) }
25
+
25
26
  it('performs a get and returns array of alert definitions') do
26
27
  expect(results).to be_a(Array)
27
28
  expect(results.first).to have_key(:_id)
28
29
  expect(results.first).to have_key(:rule_name)
29
30
  end
31
+
30
32
  it('returns no error messages') { expect(errors).to be_empty }
31
33
  end
32
34
 
@@ -35,6 +37,7 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
35
37
 
36
38
  it { expect { list }.not_to raise_error }
37
39
  it('results is nil') { expect(results).to be_nil }
40
+
38
41
  it('error messages array is populated') do
39
42
  expect(errors.first.downcase).to eq('resource not found')
40
43
  end
@@ -80,6 +83,7 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
80
83
 
81
84
  it { expect { create }.not_to raise_error }
82
85
  it('results is nil') { expect(results).to be_nil }
86
+
83
87
  it('error messages array is populated') do
84
88
  expect(errors.first.downcase).to eq('resource not found')
85
89
  end
@@ -125,6 +129,7 @@ RSpec.describe FinApps::REST::PortfoliosAlerts do
125
129
 
126
130
  it { expect { destroy }.not_to raise_error }
127
131
  it('results is nil') { expect(results).to be_nil }
132
+
128
133
  it('error messages array is populated') do
129
134
  expect(errors.first.downcase).to eq('resource not found')
130
135
  end
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
4
4
 
5
5
  RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
6
6
  include SpecHelpers::Client
7
- subject { FinApps::REST::PortfoliosAvailableConsumers.new(client) }
7
+ subject { described_class.new(client) }
8
8
 
9
9
  describe '#list' do
10
10
  let(:list) { subject.list(id, params) }
@@ -24,9 +24,11 @@ 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
+
27
28
  it('performs a get and returns the response') do
28
29
  expect(results).to have_key(:records)
29
30
  end
31
+
30
32
  it('returns no error messages') { expect(errors).to be_empty }
31
33
  end
32
34
 
@@ -39,14 +41,17 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
39
41
 
40
42
  context 'when including valid params' do
41
43
  let(:id) { 'valid_id' }
42
- let(:params) { { page: 2, sort: '-created_date', requested: 25 } }
44
+ let(:params) { {page: 2, sort: '-created_date', requested: 25} }
43
45
 
44
46
  it { expect { list }.not_to raise_error }
45
47
  it('returns an array') { expect(list).to be_a(Array) }
48
+
46
49
  it('performs a get and returns the response') do
47
50
  expect(results).to have_key(:records)
48
51
  end
52
+
49
53
  it('returns no error messages') { expect(errors).to be_empty }
54
+
50
55
  it 'builds query and sends proper request' do
51
56
  list
52
57
  url =
@@ -4,7 +4,7 @@ require 'spec_helpers/client'
4
4
 
5
5
  RSpec.describe FinApps::REST::PortfoliosConsumers do
6
6
  include SpecHelpers::Client
7
- subject { FinApps::REST::PortfoliosConsumers.new(client) }
7
+ subject { described_class.new(client) }
8
8
 
9
9
  describe '#list' do
10
10
  let(:list) { subject.list(portfolio_id, params) }
@@ -31,22 +31,27 @@ 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
+
34
35
  it('performs a get and returns the response') do
35
36
  expect(results).to have_key(:records)
36
37
  end
38
+
37
39
  it('returns no error messages') { expect(errors).to be_empty }
38
40
  end
39
41
 
40
42
  context 'when valid id is provided w/ valid params' do
41
43
  let(:portfolio_id) { 'valid_id' }
42
- let(:params) { { page: 2, sort: '-created_date', requested: 25 } }
44
+ let(:params) { {page: 2, sort: '-created_date', requested: 25} }
43
45
 
44
46
  it { expect { list }.not_to raise_error }
45
47
  it('returns an array') { expect(list).to be_a(Array) }
48
+
46
49
  it('performs a get and returns the response') do
47
50
  expect(results).to have_key(:records)
48
51
  end
52
+
49
53
  it('returns no error messages') { expect(errors).to be_empty }
54
+
50
55
  it 'builds query and sends proper request' do
51
56
  list
52
57
  url =
@@ -62,6 +67,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
62
67
 
63
68
  it { expect { list }.not_to raise_error }
64
69
  it('results is nil') { expect(results).to be_nil }
70
+
65
71
  it('error messages array is populated') do
66
72
  expect(errors.first.downcase).to eq('resource not found')
67
73
  end
@@ -100,6 +106,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
100
106
  it('returns an array') { expect(create).to be_a(Array) }
101
107
  it('results is nil') { expect(results).to be_nil }
102
108
  it('returns no error messages') { expect(errors).to be_empty }
109
+
103
110
  it('builds correct url') do
104
111
  create
105
112
  url = "#{versioned_api_path}/portfolios/#{portfolio_id}/consumers"
@@ -113,6 +120,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
113
120
 
114
121
  it { expect { create }.not_to raise_error }
115
122
  it('results is nil') { expect(results).to be_nil }
123
+
116
124
  it('error messages array is populated') do
117
125
  # this will break when client is fixed to expect new array error response
118
126
  expect(errors.first.downcase).to eq(
@@ -131,6 +139,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
131
139
  it('returns an array') { expect(create).to be_a(Array) }
132
140
  it('results is nil') { expect(results).to be_nil }
133
141
  it('returns no error messages') { expect(errors).to be_empty }
142
+
134
143
  it('builds correct url') do
135
144
  create
136
145
  url =
@@ -145,6 +154,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
145
154
 
146
155
  it { expect { create }.not_to raise_error }
147
156
  it('results is nil') { expect(results).to be_nil }
157
+
148
158
  it('error messages array is populated') do
149
159
  expect(errors.first.downcase).to eq(
150
160
  'consumer not eligible, no completed orders.'
@@ -193,6 +203,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
193
203
 
194
204
  it { expect { destroy }.not_to raise_error }
195
205
  it('results is nil') { expect(results).to be_nil }
206
+
196
207
  it('error messages array is populated') do
197
208
  expect(errors.first.downcase).to eq('resource not found')
198
209
  end