finapps 5.0.25 → 5.0.30
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/RELEASES.md +40 -0
- data/finapps.gemspec +1 -1
- data/lib/finapps.rb +6 -1
- data/lib/finapps/rest/client.rb +14 -8
- data/lib/finapps/rest/consumers.rb +3 -1
- data/lib/finapps/rest/documents_orders.rb +88 -0
- data/lib/finapps/rest/documents_orders_notifications.rb +14 -0
- data/lib/finapps/rest/esign_templates.rb +11 -0
- data/lib/finapps/rest/signed_documents_downloads.rb +15 -0
- data/lib/finapps/rest/verix/verix_documents.rb +21 -0
- data/lib/finapps/rest/verix/verix_pdf_documents.rb +15 -0
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/consumers_spec.rb +24 -1
- data/spec/rest/documents_orders_notifications_spec.rb +40 -0
- data/spec/rest/documents_orders_spec.rb +272 -0
- data/spec/rest/esign_templates_spec.rb +20 -0
- data/spec/rest/signed_documents_downloads_spec.rb +35 -0
- data/spec/rest/verix/verix_documents_spec.rb +52 -0
- data/spec/rest/verix/verix_pdf_documents_spec.rb +35 -0
- data/spec/rest/verix/verix_records_spec.rb +3 -14
- data/spec/support/fake_api.rb +74 -8
- data/spec/support/fixtures/documents_order.json +75 -0
- data/spec/support/fixtures/documents_orders.json +32 -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/support/fixtures/verix/document/document.pdf +0 -0
- data/spec/support/fixtures/verix/document/list.json +36 -0
- data/spec/support/fixtures/verix/document/show.json +35 -0
- data/spec/support/fixtures/verix/record/create.json +25 -17
- data/spec/support/fixtures/verix/record/list.json +121 -45
- metadata +80 -56
- data/lib/finapps/rest/statements.rb +0 -16
- data/spec/rest/statements_spec.rb +0 -42
- data/spec/support/fixtures/fake_pdf_statement.json +0 -3
@@ -1,16 +0,0 @@
|
|
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 =
|
11
|
-
"accounts/#{ERB::Util.url_encode(account_id)}/statement/#{ERB::Util.url_encode(document_id)}"
|
12
|
-
super nil, path
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,42 +0,0 @@
|
|
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') do
|
25
|
-
expect(show[RESULTS]).to have_key(:data)
|
26
|
-
end
|
27
|
-
it('returns no error messages') do
|
28
|
-
expect(show[ERROR_MESSAGES]).to be_empty
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
context 'when invalid ids are provided' do
|
33
|
-
let(:show) { subject.show('invalid_id', 'valid_id') }
|
34
|
-
it { expect { show }.not_to raise_error }
|
35
|
-
it('returns an array') { expect(show).to be_a(Array) }
|
36
|
-
it('results is nil') { expect(show[RESULTS]).to be_nil }
|
37
|
-
it('error messages array is populated') do
|
38
|
-
expect(show[ERROR_MESSAGES].first.downcase).to eq('resource not found')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|