finapps 2.3.2 → 2.3.3
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/lib/finapps.rb +1 -0
- data/lib/finapps/rest/client.rb +1 -0
- data/lib/finapps/rest/statements.rb +15 -0
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/client_spec.rb +4 -0
- data/spec/rest/statements_spec.rb +38 -0
- data/spec/support/fake_api.rb +4 -0
- data/spec/support/fixtures/fake_pdf_statement.json +3 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b3837e4ad6513b4ede27e48ff7b674fe7cbce17
|
4
|
+
data.tar.gz: b8f1e7f1cf52de4cf611507c330ae6365f474309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1cece3db388c511a7ade9210a19a003263b810db2bdcf5699752d41c74e55a3cd25317efddc272f0a29a90b9b72833a422e34d1c9bbd4aeccf3876c735d36f3
|
7
|
+
data.tar.gz: bf7d8267bf6622511325fa9c39ccd8cd02018480357362abd2a8d79f05c399d3247efedf8b684e4ba122dc1a6fb1eea88fd5592334b0bc40983ebc83ed1f5e31
|
data/lib/finapps.rb
CHANGED
@@ -28,6 +28,7 @@ require 'finapps/rest/products'
|
|
28
28
|
require 'finapps/rest/order_assignments'
|
29
29
|
require 'finapps/rest/client'
|
30
30
|
require 'finapps/rest/order_refreshes'
|
31
|
+
require 'finapps/rest/statements'
|
31
32
|
|
32
33
|
require 'finapps/utils/query_builder'
|
33
34
|
require 'finapps/version' unless defined?(FinApps::VERSION)
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FinApps
|
4
|
+
module REST
|
5
|
+
class Statements < FinAppsCore::REST::Resources
|
6
|
+
def show(account_id, document_id)
|
7
|
+
not_blank(account_id, :account_id)
|
8
|
+
not_blank(document_id, :document_id)
|
9
|
+
|
10
|
+
path = "accounts/#{ERB::Util.url_encode(account_id)}/statement/#{ERB::Util.url_encode(document_id)}"
|
11
|
+
super nil, path
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/finapps/version.rb
CHANGED
data/spec/rest/client_spec.rb
CHANGED
@@ -98,6 +98,10 @@ RSpec.describe FinApps::REST::Client do
|
|
98
98
|
it { expect(subject.products).to be_an_instance_of(FinApps::REST::Products) }
|
99
99
|
end
|
100
100
|
|
101
|
+
describe '#statements' do
|
102
|
+
it { expect(subject.statements).to be_an_instance_of(FinApps::REST::Statements) }
|
103
|
+
end
|
104
|
+
|
101
105
|
FinApps::REST::Client::RESOURCES.each do |method|
|
102
106
|
it "memoizes the result of #{method}" do
|
103
107
|
first = subject.send(method)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
|
5
|
+
RSpec.describe FinApps::REST::Statements do
|
6
|
+
include SpecHelpers::Client
|
7
|
+
subject { FinApps::REST::Statements.new(client) }
|
8
|
+
|
9
|
+
describe '#show' do
|
10
|
+
context 'when missing account_id' do
|
11
|
+
let(:show) { subject.show(nil, 'valid_id') }
|
12
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when missing document_id' do
|
16
|
+
let(:show) { subject.show('valid_id', nil) }
|
17
|
+
it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when valid ids are provided' do
|
21
|
+
let(:show) { subject.show('valid_id', 'valid_id') }
|
22
|
+
it { expect { show }.not_to raise_error }
|
23
|
+
it('returns an array') { expect(show).to be_a(Array) }
|
24
|
+
it('performs a get and returns the response') { expect(show[RESULTS]).to respond_to(:data) }
|
25
|
+
it('returns no error messages') { expect(show[ERROR_MESSAGES]).to be_empty }
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when invalid ids are provided' do
|
29
|
+
let(:show) { subject.show('invalid_id', 'valid_id') }
|
30
|
+
it { expect { show }.not_to raise_error }
|
31
|
+
it('returns an array') { expect(show).to be_a(Array) }
|
32
|
+
it('results is nil') { expect(show[RESULTS]).to be_nil }
|
33
|
+
it('error messages array is populated') do
|
34
|
+
expect(show[ERROR_MESSAGES].first.downcase).to eq('resource not found')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -84,6 +84,10 @@ class FakeApi < Sinatra::Base
|
|
84
84
|
delete('/v2/consumers/valid_public_id') { status 204 }
|
85
85
|
delete('/v2/consumers/invalid_public_id') { json_response 404, 'resource_not_found.json' }
|
86
86
|
|
87
|
+
# accounts
|
88
|
+
get('/v2/accounts/valid_id/statement/valid_id') { json_response 200, 'fake_pdf_statement.json' }
|
89
|
+
get('/v2/accounts/invalid_id/statement/valid_id') { json_response 404, 'resource_not_found.json' }
|
90
|
+
|
87
91
|
# operators
|
88
92
|
get('/v2/operators') { json_response 200, 'operator_list.json' }
|
89
93
|
get('/v2/operators/invalid_id') { json_response 404, 'resource_not_found.json' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- lib/finapps/rest/password_resets.rb
|
225
225
|
- lib/finapps/rest/products.rb
|
226
226
|
- lib/finapps/rest/sessions.rb
|
227
|
+
- lib/finapps/rest/statements.rb
|
227
228
|
- lib/finapps/rest/user_institutions.rb
|
228
229
|
- lib/finapps/rest/user_institutions_forms.rb
|
229
230
|
- lib/finapps/rest/user_institutions_statuses.rb
|
@@ -248,6 +249,7 @@ files:
|
|
248
249
|
- spec/rest/password_resets_spec.rb
|
249
250
|
- spec/rest/products_spec.rb
|
250
251
|
- spec/rest/sessions_spec.rb
|
252
|
+
- spec/rest/statements_spec.rb
|
251
253
|
- spec/rest/user_institutions_forms_spec.rb
|
252
254
|
- spec/rest/user_institutions_spec.rb
|
253
255
|
- spec/rest/user_institutions_statuses_spec.rb
|
@@ -256,6 +258,7 @@ files:
|
|
256
258
|
- spec/spec_helpers/client.rb
|
257
259
|
- spec/support/fake_api.rb
|
258
260
|
- spec/support/fixtures/error.json
|
261
|
+
- spec/support/fixtures/fake_pdf_statement.json
|
259
262
|
- spec/support/fixtures/institution_add.json
|
260
263
|
- spec/support/fixtures/institution_login_form.json
|
261
264
|
- spec/support/fixtures/institutions_routing_number.json
|
@@ -319,6 +322,7 @@ summary: FinApps REST API ruby client.
|
|
319
322
|
test_files:
|
320
323
|
- spec/rest/operators_password_resets_spec.rb
|
321
324
|
- spec/rest/products_spec.rb
|
325
|
+
- spec/rest/statements_spec.rb
|
322
326
|
- spec/rest/version_spec.rb
|
323
327
|
- spec/rest/user_institutions_forms_spec.rb
|
324
328
|
- spec/rest/consumers_spec.rb
|