finapps 5.0.32 → 5.0.33

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -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 { FinApps::REST::Portfolios.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::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) { { 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 =
@@ -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) { { fake: 'data' } }
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) { { fake: 'data' } }
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) { { fake: 'data' } }
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
@@ -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) { FinApps::REST::Products.new(client) }
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
@@ -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 { FinApps::REST::Sessions.new(client) }
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
- { email: 'email@domain.com', password: 'invalid_password' }
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
- { email: 'email@domain.com', password: 'valid_password' }
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
- { email: 'email@domain.com', password: 'valid_password' }
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
@@ -7,16 +7,16 @@ RSpec.describe FinApps::REST::SignedDocumentsDownloads do
7
7
  include SpecHelpers::Client
8
8
 
9
9
  let(:api_client) { client }
10
- let(:document) { FinApps::REST::SignedDocumentsDownloads.new(api_client) }
10
+ let(:document) { described_class.new(api_client) }
11
11
 
12
12
  describe '#show' do
13
13
  context 'when missing parameters' do
14
- subject { document.show(nil, :signature_request_id) }
14
+ subject { document.show(:consumer_id, nil) }
15
+
15
16
  it 'raises an error when missing consumer id' do
16
17
  expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
17
18
  end
18
19
 
19
- subject { document.show(:consumer_id, nil) }
20
20
  it 'raises an error when missing signature request id' do
21
21
  expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
22
22
  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 { FinApps::REST::TenantAppSettings.new(client) }
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) { { pdf_statement_months: 2 } }
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) { { pdf_statement_months: nil } }
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 { FinApps::REST::TenantSettings.new(client) }
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) { { iav_default_product: 'valid' } }
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) { { bad_params: true } }
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) { FinApps::REST::VerixDocuments.new(api_client) }
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(:list) do
21
- document.list(
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 parameters' do
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
- subject { document.show(:record_id, nil) }
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
- subject(:show) do
43
- document.show(
44
- :record_id,
45
- :document_id
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) { FinApps::REST::VerixMetadata.new(api_client).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) { FinApps::REST::VerixPdfDocuments.new(api_client) }
10
+ let(:document) { described_class.new(api_client) }
11
11
 
12
12
  describe '#show' do
13
- context 'when missing parameters' do
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
@@ -6,12 +6,11 @@ require 'rest/api_request'
6
6
  RSpec.describe FinApps::REST::VerixRecords do
7
7
  include SpecHelpers::Client
8
8
 
9
- # noinspection RubyBlockToMethodReference
10
9
  let(:api_client) { client }
11
10
 
12
11
  describe '#create' do
13
12
  subject(:create) do
14
- FinApps::REST::VerixRecords.new(api_client).create(
13
+ described_class.new(api_client).create(
15
14
  code: 'authcode'
16
15
  )
17
16
  end
@@ -19,24 +18,46 @@ RSpec.describe FinApps::REST::VerixRecords do
19
18
  it_behaves_like 'an API request'
20
19
  it_behaves_like 'a successful request'
21
20
  it('returns an id') { expect(create[RESULTS]).to have_key(:_id) }
22
- it('returns a consumer id') { expect(create[RESULTS]).to have_key(:consumer_id) }
21
+
22
+ it('returns a consumer id') {
23
+ expect(create[RESULTS]).to have_key(:consumer_id)
24
+ }
25
+
23
26
  it('returns a status') { expect(create[RESULTS]).to have_key(:status) }
24
27
  it('returns an error node') { expect(create[RESULTS]).to have_key(:error) }
25
- it('returns a list of documents') { expect(create[RESULTS]).to have_key(:documents) }
26
- it('returns a list of downloaded documents') { expect(create[RESULTS]).to have_key(:downloaded_documents) }
28
+
29
+ it('returns a list of documents') {
30
+ expect(create[RESULTS]).to have_key(:documents)
31
+ }
32
+
33
+ it('returns a list of downloaded documents') {
34
+ expect(create[RESULTS]).to have_key(:downloaded_documents)
35
+ }
27
36
  end
28
37
 
29
38
  describe '#list' do
30
- subject(:list) { FinApps::REST::VerixRecords.new(api_client).list }
39
+ subject(:list) { described_class.new(api_client).list }
31
40
 
32
41
  it_behaves_like 'an API request'
33
42
  it_behaves_like 'a successful request'
34
43
  it('returns an array') { expect(list[RESULTS]).to be_an_instance_of(Array) }
35
44
  it('returns an id') { expect(list[RESULTS].first).to have_key(:_id) }
36
45
  it('returns a status') { expect(list[RESULTS].first).to have_key(:status) }
37
- it('returns a consumer id') { expect(list[RESULTS].first).to have_key(:consumer_id) }
38
- it('returns an error node') { expect(list[RESULTS].first).to have_key(:error) }
39
- it('returns a list of documents') { expect(list[RESULTS].first).to have_key(:documents) }
40
- it('returns a list of downloaded documents') { expect(list[RESULTS].first).to have_key(:downloaded_documents) }
46
+
47
+ it('returns a consumer id') {
48
+ expect(list[RESULTS].first).to have_key(:consumer_id)
49
+ }
50
+
51
+ it('returns an error node') {
52
+ expect(list[RESULTS].first).to have_key(:error)
53
+ }
54
+
55
+ it('returns a list of documents') {
56
+ expect(list[RESULTS].first).to have_key(:documents)
57
+ }
58
+
59
+ it('returns a list of downloaded documents') {
60
+ expect(list[RESULTS].first).to have_key(:downloaded_documents)
61
+ }
41
62
  end
42
63
  end