finapps 2.3.1 → 2.3.2
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/rest/client.rb +1 -0
- data/lib/finapps/rest/order_refreshes.rb +13 -0
- data/lib/finapps/version.rb +1 -1
- data/lib/finapps.rb +1 -0
- data/spec/rest/client_spec.rb +4 -0
- data/spec/rest/order_refreshes_spec.rb +36 -0
- data/spec/support/fake_api.rb +2 -0
- data/spec/support/fixtures/order_refresh.json +42 -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: 1a0a84b68f05e8ad0d5d21c0ccc3543265cee215
|
4
|
+
data.tar.gz: e024e65fba9dcbec6e9b3527d8d010d27b69dbe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '080546f143baf20e47038846ffda7873bf3a74b502c558f9b2f294867da628e7016607ecf70d4e396c80248b6977e47f8b6bf5af6709a93c54a4e7460a4efab3'
|
7
|
+
data.tar.gz: f856e092fd9732f10e174d08519b2c99f1c06de4706183e95379f67b98c9980c6d212082ae4d69f2832c4c7a6c78a82d4e25fe2442e30fa917079efe15983694
|
data/lib/finapps/rest/client.rb
CHANGED
data/lib/finapps/version.rb
CHANGED
data/lib/finapps.rb
CHANGED
@@ -27,6 +27,7 @@ require 'finapps/rest/operators_password_resets'
|
|
27
27
|
require 'finapps/rest/products'
|
28
28
|
require 'finapps/rest/order_assignments'
|
29
29
|
require 'finapps/rest/client'
|
30
|
+
require 'finapps/rest/order_refreshes'
|
30
31
|
|
31
32
|
require 'finapps/utils/query_builder'
|
32
33
|
require 'finapps/version' unless defined?(FinApps::VERSION)
|
data/spec/rest/client_spec.rb
CHANGED
@@ -46,6 +46,10 @@ RSpec.describe FinApps::REST::Client do
|
|
46
46
|
it { expect(subject.order_statuses).to be_an_instance_of(FinApps::REST::OrderStatuses) }
|
47
47
|
end
|
48
48
|
|
49
|
+
describe '#order_refreshes' do
|
50
|
+
it { expect(subject.order_refreshes).to be_an_instance_of(FinApps::REST::OrderRefreshes) }
|
51
|
+
end
|
52
|
+
|
49
53
|
describe '#order_reports' do
|
50
54
|
it { expect(subject.order_reports).to be_an_instance_of(FinApps::REST::OrderReports) }
|
51
55
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
|
5
|
+
RSpec.describe FinApps::REST::OrderRefreshes do
|
6
|
+
include SpecHelpers::Client
|
7
|
+
subject { FinApps::REST::OrderRefreshes.new(client) }
|
8
|
+
|
9
|
+
describe '#create' do
|
10
|
+
context 'when missing id' do
|
11
|
+
let(:create) { subject.create(nil) }
|
12
|
+
it { expect { create }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when valid id is provided' do
|
16
|
+
let(:create) { subject.create(:valid_id) }
|
17
|
+
it { expect { create }.not_to raise_error }
|
18
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
19
|
+
it('performs a post and returns new refreshed order response') do
|
20
|
+
expect(create[RESULTS]).to respond_to(:public_id)
|
21
|
+
expect(create[RESULTS]).to respond_to(:original_order_id)
|
22
|
+
end
|
23
|
+
it('returns no error messages') { expect(create[ERROR_MESSAGES]).to be_empty }
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when invalid id is provided' do
|
27
|
+
let(:create) { subject.create(:invalid_id) }
|
28
|
+
it { expect { create }.not_to raise_error }
|
29
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
30
|
+
it('results is nil') { expect(create[RESULTS]).to be_nil }
|
31
|
+
it('error messages array is populated') do
|
32
|
+
expect(create[ERROR_MESSAGES].first.downcase).to eq('resource not found')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -27,6 +27,8 @@ class FakeApi < Sinatra::Base
|
|
27
27
|
put('/v2/orders/invalid_id/cancel') { json_response 404, 'resource_not_found.json' }
|
28
28
|
put('/v2/orders/valid_id/notify') { status 204 }
|
29
29
|
put('/v2/orders/invalid_id/notify') { json_response 404, 'resource_not_found.json' }
|
30
|
+
put('/v2/orders/valid_id/refresh') { json_response 200, 'order_refresh.json' }
|
31
|
+
put('/v2/orders/invalid_id/refresh') { json_response 404, 'resource_not_found.json' }
|
30
32
|
put('/v2/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
|
31
33
|
put('/v2/orders/valid_id') do
|
32
34
|
request.body.rewind
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"public_id": "486bafd8-dc8f-4212-70d5-dfe1d3a211fc",
|
3
|
+
"consumer_id": "f6c14d28-182a-4580-40b6-3447b10db3d2",
|
4
|
+
"applicant": {
|
5
|
+
"first_name": "Erich",
|
6
|
+
"last_name": "Quintero",
|
7
|
+
"ssn": "",
|
8
|
+
"email": "erich@financialapps.com"
|
9
|
+
},
|
10
|
+
"institutions": [
|
11
|
+
{
|
12
|
+
"name": "",
|
13
|
+
"public_id": "",
|
14
|
+
"routing_no": "",
|
15
|
+
"site_id": 0,
|
16
|
+
"accounts": [
|
17
|
+
{
|
18
|
+
"public_id": "",
|
19
|
+
"account_id": "59ea568cd47de6000b5dce71",
|
20
|
+
"name_on_account": ""
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"public_id": "",
|
24
|
+
"account_id": "59ea568cd47de6000b5dce70",
|
25
|
+
"name_on_account": ""
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"product": {
|
31
|
+
"code": "mav-o-en",
|
32
|
+
"description": "Mortgage Asset Verification",
|
33
|
+
"flow_type": 1,
|
34
|
+
"template_public_id": "e38d2f23-2f93-4e83-a64b-8d60f25e3a7a"
|
35
|
+
},
|
36
|
+
"requestor": {},
|
37
|
+
"status": 1,
|
38
|
+
"tpr_id": "5369c728ec",
|
39
|
+
"type": 1,
|
40
|
+
"original_order_id": "819f55d7-f433-40fc-7e56-27685f4f3402",
|
41
|
+
"date": "2017-10-23T15:21:41.349116765Z"
|
42
|
+
}
|
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.2
|
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-10-
|
11
|
+
date: 2017-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- lib/finapps/rest/operators_password_resets.rb
|
217
217
|
- lib/finapps/rest/order_assignments.rb
|
218
218
|
- lib/finapps/rest/order_notifications.rb
|
219
|
+
- lib/finapps/rest/order_refreshes.rb
|
219
220
|
- lib/finapps/rest/order_reports.rb
|
220
221
|
- lib/finapps/rest/order_statuses.rb
|
221
222
|
- lib/finapps/rest/order_tokens.rb
|
@@ -239,6 +240,7 @@ files:
|
|
239
240
|
- spec/rest/operators_spec.rb
|
240
241
|
- spec/rest/order_assignments_spec.rb
|
241
242
|
- spec/rest/order_notifications_spec.rb
|
243
|
+
- spec/rest/order_refreshes_spec.rb
|
242
244
|
- spec/rest/order_reports_spec.rb
|
243
245
|
- spec/rest/order_statuses_spec.rb
|
244
246
|
- spec/rest/order_tokens_spec.rb
|
@@ -266,6 +268,7 @@ files:
|
|
266
268
|
- spec/support/fixtures/operator_forgot_password.json
|
267
269
|
- spec/support/fixtures/operator_list.json
|
268
270
|
- spec/support/fixtures/order.json
|
271
|
+
- spec/support/fixtures/order_refresh.json
|
269
272
|
- spec/support/fixtures/order_report.json
|
270
273
|
- spec/support/fixtures/order_status.json
|
271
274
|
- spec/support/fixtures/order_token.json
|
@@ -331,6 +334,7 @@ test_files:
|
|
331
334
|
- spec/rest/order_reports_spec.rb
|
332
335
|
- spec/rest/institutions_spec.rb
|
333
336
|
- spec/rest/order_statuses_spec.rb
|
337
|
+
- spec/rest/order_refreshes_spec.rb
|
334
338
|
- spec/rest/order_notifications_spec.rb
|
335
339
|
- spec/rest/order_assignments_spec.rb
|
336
340
|
- spec/rest/sessions_spec.rb
|