finapps 2.2.17 → 2.2.18
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/order_notifications.rb +13 -0
- data/lib/finapps/rest/orders.rb +9 -1
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/client_spec.rb +4 -0
- data/spec/rest/order_notifications_spec.rb +35 -0
- data/spec/rest/orders_spec.rb +29 -0
- data/spec/support/fake_api.rb +4 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c589e3db135efac7608182b06253c4486ffb2d41
|
4
|
+
data.tar.gz: 9dda7d435559e4331224a543bfb65311edd34294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b76819e08295bd3960a7a16e3b98bd598f10610eeabb891d52d2fdf81ba4a533a55756ee29bf4170abf3eda7d21dfea5de50f0d28d0d7f263ff69319223e822
|
7
|
+
data.tar.gz: 55d096c4eaf472daa1440cfd8fe8b44500452c1a6a998a5a98d3ffcc5c8c375ca1115360a0e1cd98bc4d253285efb6e69175f8d873ac6f9b189fd40834bd87d3
|
data/lib/finapps.rb
CHANGED
@@ -20,6 +20,7 @@ require 'finapps/rest/user_institutions'
|
|
20
20
|
require 'finapps/rest/user_institutions_forms'
|
21
21
|
require 'finapps/rest/order_reports'
|
22
22
|
require 'finapps/rest/order_statuses'
|
23
|
+
require 'finapps/rest/order_notifications'
|
23
24
|
require 'finapps/rest/password_resets'
|
24
25
|
require 'finapps/rest/operators'
|
25
26
|
require 'finapps/rest/operators_password_resets'
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module FinApps
|
3
|
+
module REST
|
4
|
+
class OrderNotifications < FinAppsCore::REST::Resources
|
5
|
+
def update(id)
|
6
|
+
not_blank(id, :id)
|
7
|
+
|
8
|
+
path = "orders/#{ERB::Util.url_encode(id)}/notify"
|
9
|
+
super nil, path
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/finapps/rest/orders.rb
CHANGED
@@ -28,7 +28,8 @@ module FinApps
|
|
28
28
|
super build_query_path(end_point, params)
|
29
29
|
end
|
30
30
|
|
31
|
-
def update(id, params)
|
31
|
+
def update(id, params, path=nil)
|
32
|
+
return super nil, path if path
|
32
33
|
not_blank(id, :id)
|
33
34
|
not_blank(params, :params)
|
34
35
|
# Params array need matching Institution ids & Account ids
|
@@ -39,6 +40,13 @@ module FinApps
|
|
39
40
|
|
40
41
|
super params, path
|
41
42
|
end
|
43
|
+
|
44
|
+
def destroy(id)
|
45
|
+
not_blank(id, :id)
|
46
|
+
|
47
|
+
path = "#{end_point}/#{ERB::Util.url_encode(id)}/cancel"
|
48
|
+
update nil, nil, path
|
49
|
+
end
|
42
50
|
end
|
43
51
|
end
|
44
52
|
end
|
data/lib/finapps/version.rb
CHANGED
data/spec/rest/client_spec.rb
CHANGED
@@ -27,6 +27,10 @@ RSpec.describe FinApps::REST::Client do
|
|
27
27
|
it { expect(subject.sessions).to be_an_instance_of(FinApps::REST::Sessions) }
|
28
28
|
end
|
29
29
|
|
30
|
+
describe '#order_statuses' do
|
31
|
+
it { expect(subject.order_notifications).to be_an_instance_of(FinApps::REST::OrderNotifications) }
|
32
|
+
end
|
33
|
+
|
30
34
|
describe '#order_statuses' do
|
31
35
|
it { expect(subject.order_statuses).to be_an_instance_of(FinApps::REST::OrderStatuses) }
|
32
36
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helpers/client'
|
3
|
+
|
4
|
+
RSpec.describe FinApps::REST::OrderNotifications do
|
5
|
+
include SpecHelpers::Client
|
6
|
+
|
7
|
+
describe '#update' do
|
8
|
+
subject(:orders) { FinApps::REST::OrderNotifications.new(client) }
|
9
|
+
|
10
|
+
context 'when missing id' do
|
11
|
+
let(:update) { subject.update(nil) }
|
12
|
+
it('returns missing argument error') { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when invalid id is provided' do
|
16
|
+
let(:update) { subject.update(:invalid_id) }
|
17
|
+
let(:results) { update[RESULTS] }
|
18
|
+
let(:error_messages) { update[ERROR_MESSAGES] }
|
19
|
+
|
20
|
+
it { expect { update }.not_to raise_error }
|
21
|
+
it('results is nil') { expect(results).to be_nil }
|
22
|
+
it('error messages array is populated') { expect(error_messages.first.downcase).to eq('resource not found') }
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'for valid id' do
|
26
|
+
let(:update) { subject.update(:valid_id) }
|
27
|
+
let(:results) { update[RESULTS] }
|
28
|
+
let(:error_messages) { update[ERROR_MESSAGES] }
|
29
|
+
|
30
|
+
it { expect { update }.not_to raise_error }
|
31
|
+
it('results is nil') { expect(results).to be_nil }
|
32
|
+
it('error_messages array is empty') { expect(error_messages).to eq([]) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/rest/orders_spec.rb
CHANGED
@@ -133,4 +133,33 @@ RSpec.describe FinApps::REST::Orders do
|
|
133
133
|
it('error messages array is populated') { expect(error_messages.first.downcase).to eq('invalid request body') }
|
134
134
|
end
|
135
135
|
end
|
136
|
+
|
137
|
+
describe '#destroy' do
|
138
|
+
subject(:orders) { FinApps::REST::Orders.new(client) }
|
139
|
+
|
140
|
+
context 'when missing id' do
|
141
|
+
let(:destroy) { subject.destroy(nil) }
|
142
|
+
it('returns missing argument error') { expect { destroy }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
143
|
+
end
|
144
|
+
|
145
|
+
context 'when invalid id is provided' do
|
146
|
+
let(:destroy) { subject.destroy(:invalid_id) }
|
147
|
+
let(:results) { destroy[RESULTS] }
|
148
|
+
let(:error_messages) { destroy[ERROR_MESSAGES] }
|
149
|
+
|
150
|
+
it { expect { destroy }.not_to raise_error }
|
151
|
+
it('results is nil') { expect(results).to be_nil }
|
152
|
+
it('error messages array is populated') { expect(error_messages.first.downcase).to eq('resource not found') }
|
153
|
+
end
|
154
|
+
|
155
|
+
context 'for valid id' do
|
156
|
+
let(:destroy) { subject.destroy(:valid_id) }
|
157
|
+
let(:results) { destroy[RESULTS] }
|
158
|
+
let(:error_messages) { destroy[ERROR_MESSAGES] }
|
159
|
+
|
160
|
+
it { expect { destroy }.not_to raise_error }
|
161
|
+
it('results is nil') { expect(results).to be_nil }
|
162
|
+
it('error_messages array is empty') { expect(error_messages).to eq([]) }
|
163
|
+
end
|
164
|
+
end
|
136
165
|
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -22,6 +22,10 @@ class FakeApi < Sinatra::Base
|
|
22
22
|
get('/v2/orders/invalid_id/report.:format') { json_response 404, 'resource_not_found.json' }
|
23
23
|
get('/v2/orders/valid_id/status') { json_response 200, 'order_status.json' }
|
24
24
|
get('/v2/orders/invalid_id/status') { json_response 404, 'resource_not_found.json' }
|
25
|
+
put('/v2/orders/valid_id/cancel') { status 204 }
|
26
|
+
put('/v2/orders/invalid_id/cancel') { json_response 404, 'resource_not_found.json' }
|
27
|
+
put('/v2/orders/valid_id/notify') { status 204 }
|
28
|
+
put('/v2/orders/invalid_id/notify') { json_response 404, 'resource_not_found.json' }
|
25
29
|
put('/v2/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
|
26
30
|
put('/v2/orders/valid_id') do
|
27
31
|
request.body.rewind
|
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.2.
|
4
|
+
version: 2.2.18
|
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-05-
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- lib/finapps/rest/institutions_forms.rb
|
240
240
|
- lib/finapps/rest/operators.rb
|
241
241
|
- lib/finapps/rest/operators_password_resets.rb
|
242
|
+
- lib/finapps/rest/order_notifications.rb
|
242
243
|
- lib/finapps/rest/order_reports.rb
|
243
244
|
- lib/finapps/rest/order_statuses.rb
|
244
245
|
- lib/finapps/rest/order_tokens.rb
|
@@ -259,6 +260,7 @@ files:
|
|
259
260
|
- spec/rest/institutions_spec.rb
|
260
261
|
- spec/rest/operators_password_resets_spec.rb
|
261
262
|
- spec/rest/operators_spec.rb
|
263
|
+
- spec/rest/order_notifications_spec.rb
|
262
264
|
- spec/rest/order_reports_spec.rb
|
263
265
|
- spec/rest/order_statuses_spec.rb
|
264
266
|
- spec/rest/order_tokens_spec.rb
|
@@ -350,6 +352,7 @@ test_files:
|
|
350
352
|
- spec/rest/order_reports_spec.rb
|
351
353
|
- spec/rest/institutions_spec.rb
|
352
354
|
- spec/rest/order_statuses_spec.rb
|
355
|
+
- spec/rest/order_notifications_spec.rb
|
353
356
|
- spec/rest/sessions_spec.rb
|
354
357
|
- spec/support/fake_api.rb
|
355
358
|
- spec/utils/query_builder_spec.rb
|