finapps 2.2.20 → 2.2.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9610a61e7965c36b87af664ac1e86dcd3970dd07
4
- data.tar.gz: 4776a8fac95ed1486e83b9e1e253a8c0a2ff5efe
3
+ metadata.gz: b8522b2aee7c10b0ffc1904184a262c6a259ed6d
4
+ data.tar.gz: 623f76042a89eb0a09fe6b3af68fafe410d5c908
5
5
  SHA512:
6
- metadata.gz: f0b15c4f7294e8f7bd3743c5bc86e336fb5545bd4643368e690e9f0ce02e31f16ae6e32fa9e32fc4899b91c3f7c7b8c08357896f81eee29497083897af7a7045
7
- data.tar.gz: 2d65c6d31ee6e6d465939439eb8ccc3a80a6406c1ba7152924c372256d4eff029af3249dcc14ab7774cfc3f2ecdfeaa26e933ae40121916bdae02fc5f4f924a4
6
+ metadata.gz: 376e0cdc4992f34f5144a330bd7ca90f1fb4b2e8987a3b88c6bb65536e36dd5810573e5099b48f3a5098c8f717b4986148738f6aa92b86755c3a0d49008bd5ed
7
+ data.tar.gz: 5c5c7bd72827b4fb4b5e4a4624f439d1938a031220cb11b6f1c7b37ba1591a67fc3485bf18bd5d11a3dc2016db8e8015b6fa912c49309b5ed276dac37414d676
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  coverage/
3
3
  *.gem
4
4
  .config
5
- Gemfile.lock
6
5
  lib/bundler/man
7
6
  pkg
8
7
  rdoc
data/Gemfile.lock ADDED
@@ -0,0 +1,102 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ finapps (2.2.20)
5
+ finapps_core (~> 2.0, >= 2.0.19)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.5.0)
11
+ public_suffix (~> 2.0, >= 2.0.2)
12
+ ast (2.3.0)
13
+ codeclimate-test-reporter (1.0.8)
14
+ simplecov (<= 0.13)
15
+ crack (0.4.3)
16
+ safe_yaml (~> 1.0.0)
17
+ diff-lcs (1.2.5)
18
+ docile (1.1.5)
19
+ ethon (0.10.1)
20
+ ffi (>= 1.3.0)
21
+ faraday (0.12.1)
22
+ multipart-post (>= 1.2, < 3)
23
+ faraday_middleware (0.11.0.1)
24
+ faraday (>= 0.7.4, < 1.0)
25
+ ffi (1.9.18)
26
+ finapps_core (2.0.19)
27
+ faraday (~> 0.11, >= 0.11.0)
28
+ faraday_middleware (~> 0.11, >= 0.11.0.1)
29
+ rash (~> 0.4, >= 0.4.0)
30
+ typhoeus (~> 1.1, >= 1.1.2)
31
+ gem-release (0.7.4)
32
+ hashdiff (0.3.2)
33
+ hashie (2.0.5)
34
+ json (2.0.2)
35
+ multipart-post (2.0.0)
36
+ parser (2.4.0.0)
37
+ ast (~> 2.2)
38
+ powerpack (0.1.1)
39
+ public_suffix (2.0.5)
40
+ rack (1.6.5)
41
+ rack-protection (1.5.3)
42
+ rack
43
+ rainbow (2.2.1)
44
+ rake (12.0.0)
45
+ rash (0.4.0)
46
+ hashie (~> 2.0.0)
47
+ rspec (3.5.0)
48
+ rspec-core (~> 3.5.0)
49
+ rspec-expectations (~> 3.5.0)
50
+ rspec-mocks (~> 3.5.0)
51
+ rspec-core (3.5.4)
52
+ rspec-support (~> 3.5.0)
53
+ rspec-expectations (3.5.0)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.5.0)
56
+ rspec-mocks (3.5.0)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.5.0)
59
+ rspec-support (3.5.0)
60
+ rubocop (0.47.1)
61
+ parser (>= 2.3.3.1, < 3.0)
62
+ powerpack (~> 0.1)
63
+ rainbow (>= 1.99.1, < 3.0)
64
+ ruby-progressbar (~> 1.7)
65
+ unicode-display_width (~> 1.0, >= 1.0.1)
66
+ ruby-progressbar (1.8.1)
67
+ safe_yaml (1.0.4)
68
+ simplecov (0.12.0)
69
+ docile (~> 1.1.0)
70
+ json (>= 1.8, < 3)
71
+ simplecov-html (~> 0.10.0)
72
+ simplecov-html (0.10.0)
73
+ sinatra (1.4.7)
74
+ rack (~> 1.5)
75
+ rack-protection (~> 1.4)
76
+ tilt (>= 1.3, < 3)
77
+ tilt (2.0.5)
78
+ typhoeus (1.1.2)
79
+ ethon (>= 0.9.0)
80
+ unicode-display_width (1.1.3)
81
+ webmock (2.3.2)
82
+ addressable (>= 2.3.6)
83
+ crack (>= 0.3.2)
84
+ hashdiff
85
+
86
+ PLATFORMS
87
+ ruby
88
+
89
+ DEPENDENCIES
90
+ bundler (~> 1.14, >= 1.14.3)
91
+ codeclimate-test-reporter (~> 1.0, >= 1.0.5)
92
+ finapps!
93
+ gem-release (~> 0.7, >= 0.7.4)
94
+ rake (~> 12.0, >= 12.0.0)
95
+ rspec (~> 3.5, >= 3.5.0)
96
+ rubocop (~> 0.47, >= 0.47.1)
97
+ simplecov (~> 0.11, >= 0.11.2)
98
+ sinatra (~> 1.4, >= 1.4.7)
99
+ webmock (~> 2.3, >= 2.3.2)
100
+
101
+ BUNDLED WITH
102
+ 1.14.6
data/lib/finapps.rb CHANGED
@@ -25,6 +25,7 @@ require 'finapps/rest/password_resets'
25
25
  require 'finapps/rest/operators'
26
26
  require 'finapps/rest/operators_password_resets'
27
27
  require 'finapps/rest/products'
28
+ require 'finapps/rest/order_assignments'
28
29
  require 'finapps/utils/query_builder'
29
30
 
30
31
  require 'finapps/rest/client'
@@ -9,6 +9,7 @@ module FinApps
9
9
  institutions
10
10
  institutions_forms
11
11
  orders
12
+ order_assignments
12
13
  order_notifications
13
14
  order_reports
14
15
  order_statuses
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ module FinApps
3
+ module REST
4
+ class OrderAssignments < FinAppsCore::REST::Resources
5
+ def update(id, orders_array)
6
+ not_blank(id, :operator_id)
7
+ not_blank(orders_array, :params)
8
+ raise FinAppsCore::InvalidArgumentsError.new 'Invalid argument: params' unless orders_array.is_a? Array
9
+
10
+ path = "operators/#{ERB::Util.url_encode(id)}/assign"
11
+ super orders_array, path
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
- VERSION = '2.2.20'
3
+ VERSION = '2.2.21'
4
4
  end
@@ -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_assignments' do
31
+ it { expect(subject.order_assignments).to be_an_instance_of(FinApps::REST::OrderAssignments) }
32
+ end
33
+
30
34
  describe '#order_statuses' do
31
35
  it { expect(subject.order_notifications).to be_an_instance_of(FinApps::REST::OrderNotifications) }
32
36
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helpers/client'
3
+
4
+ RSpec.describe FinApps::REST::OrderAssignments do
5
+ include SpecHelpers::Client
6
+
7
+ describe '#update' do
8
+ subject(:order_assignments) { FinApps::REST::OrderAssignments.new(client) }
9
+ let(:results) { update[RESULTS] }
10
+ let(:error_messages) { update[ERROR_MESSAGES] }
11
+
12
+ context 'when missing id' do
13
+ let(:update) { subject.update(nil, []) }
14
+ it('returns missing argument error') { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
15
+ end
16
+
17
+ context 'when missing params' do
18
+ let(:update) { subject.update(:valid_id, nil) }
19
+ it('returns missing argument error') { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
20
+ end
21
+
22
+ context 'with invalid params' do
23
+ let(:update) { subject.update(:valid_id, params: 'params') }
24
+ it('returns invalid argument error') { expect { update }.to raise_error(FinAppsCore::InvalidArgumentsError) }
25
+ end
26
+
27
+ context 'with invalid operator' do
28
+ let(:update) { subject.update(:invalid_id, ['invalid']) }
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 populated') do
33
+ expect(error_messages.first.downcase).to eq('resource not found')
34
+ end
35
+ end
36
+
37
+ context 'with valid params' do
38
+ let(:update) { subject.update(:valid_id, ['valid']) }
39
+
40
+ it { expect { update }.not_to raise_error }
41
+ it('results is nil') { expect(results).to be_nil }
42
+ it('error_messages array is empty') { expect(error_messages).to eq([]) }
43
+ end
44
+ end
45
+ end
@@ -90,6 +90,8 @@ class FakeApi < Sinatra::Base
90
90
  post('/v2/operators/password/change') { json_response 200, 'operator.json' }
91
91
  put('/v2/operators/invalid_id') { json_response 404, 'resource_not_found.json' }
92
92
  put('/v2/operators/valid_id') { json_response 200, 'operator.json' }
93
+ put('/v2/operators/valid_id/assign') { status 204 }
94
+ put('/v2/operators/invalid_id/assign') { json_response 404, 'resource_not_found.json' }
93
95
  post('/v2/operators/password/forgot') { json_response 200, 'operator_forgot_password.json' }
94
96
  post('/v2/operators/password/reset') do
95
97
  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.20
4
+ version: 2.2.21
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-06-12 00:00:00.000000000 Z
11
+ date: 2017-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -228,6 +228,7 @@ files:
228
228
  - ".ruby-version"
229
229
  - ".travis.yml"
230
230
  - Gemfile
231
+ - Gemfile.lock
231
232
  - LICENSE.txt
232
233
  - README.md
233
234
  - Rakefile
@@ -239,6 +240,7 @@ files:
239
240
  - lib/finapps/rest/institutions_forms.rb
240
241
  - lib/finapps/rest/operators.rb
241
242
  - lib/finapps/rest/operators_password_resets.rb
243
+ - lib/finapps/rest/order_assignments.rb
242
244
  - lib/finapps/rest/order_notifications.rb
243
245
  - lib/finapps/rest/order_reports.rb
244
246
  - lib/finapps/rest/order_statuses.rb
@@ -260,6 +262,7 @@ files:
260
262
  - spec/rest/institutions_spec.rb
261
263
  - spec/rest/operators_password_resets_spec.rb
262
264
  - spec/rest/operators_spec.rb
265
+ - spec/rest/order_assignments_spec.rb
263
266
  - spec/rest/order_notifications_spec.rb
264
267
  - spec/rest/order_reports_spec.rb
265
268
  - spec/rest/order_statuses_spec.rb
@@ -353,6 +356,7 @@ test_files:
353
356
  - spec/rest/institutions_spec.rb
354
357
  - spec/rest/order_statuses_spec.rb
355
358
  - spec/rest/order_notifications_spec.rb
359
+ - spec/rest/order_assignments_spec.rb
356
360
  - spec/rest/sessions_spec.rb
357
361
  - spec/support/fake_api.rb
358
362
  - spec/utils/query_builder_spec.rb