finapps 5.0.47 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 487960017ebcda19c22179e090cb9328708a57dd5e54e0d05cc27e5660251d57
4
- data.tar.gz: 95abe37a2a66f36f973eb453d2302df92a9d1208c2ad5f20b4b6caf21737c358
3
+ metadata.gz: 376f28da5e635a8ad2bb605ed938fd3c27d06d826818a8b050e0bcc5cf3ffb62
4
+ data.tar.gz: e1a10a00165e243ce8b8558efcc3e666f9f06c6f1a2344004c5f5f0182b15bd8
5
5
  SHA512:
6
- metadata.gz: 5df1695cc14dc3a96d47867786a7f564806b5f58d56511c9e08482e3e9ce4767ac03257c055f644b2517d25666a70d0b6312f43fd218607258c642d967061a98
7
- data.tar.gz: 9f063fed1bafb02f77ed3b10230c77d757e0ae09c0f7d202f9d78d699dc1d7ba5f0809d59591f608c32aa9c81d86795b932ab5220d0adc13fcea07b2583c4d26
6
+ metadata.gz: b26f301279eefa97fbf482adb264d403de9978146513519916b6cfd7f7d2b8f16a85bc7abddc2254b33ee0de9e5e92897546f4c16e799d6e91374863a9636457
7
+ data.tar.gz: d2c9335df63d6021e1e825bbfd5605dcbf3c969b691d0ac991d68dcbcffb2a0c10cf0c3a21f6c5ab2a4b678bf77603771f80a1161e8d36889e1f171ea8963d80
@@ -1,9 +1,16 @@
1
1
  name: Continuous Integration
2
2
 
3
- on: [push, pull_request]
4
-
3
+ on:
4
+ push:
5
+ paths-ignore:
6
+ - ".github/**"
7
+ - ".VERSION"
8
+ pull_request:
9
+ paths-ignore:
10
+ - ".github/**"
11
+ - ".VERSION"
5
12
  jobs:
6
- ci:
13
+ tests:
7
14
  if: "!contains(github.event.head_commit.message, 'skip ci')"
8
15
  runs-on: ubuntu-latest
9
16
 
@@ -11,26 +18,30 @@ jobs:
11
18
  fail-fast: true
12
19
 
13
20
  steps:
14
- - uses: actions/checkout@v1
21
+ - name: Checkout source code
22
+ uses: actions/checkout@v2
15
23
 
16
24
  - name: Install required ruby
17
25
  uses: ruby/setup-ruby@v1
18
26
 
19
- - uses: actions/cache@v2
27
+ - name: Setup cache key and directory for gems cache
28
+ uses: actions/cache@v2
20
29
  with:
21
30
  path: vendor/bundle
22
31
  key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
23
32
  restore-keys: |
24
33
  ${{ runner.os }}-gems-
25
34
 
26
- - name: Install gems
35
+ - name: Bundle install
27
36
  run: |
28
- gem install -N bundler
29
37
  bundle config path vendor/bundle
30
- bundle install --jobs 4 --retry 3
38
+ bundle config set jobs 4
39
+ bundle config set retry 3
40
+ bundle install
31
41
 
32
42
  - name: Run rubocop
33
- run: bundle exec rubocop
43
+ run: |
44
+ bundle exec rubocop --parallel
34
45
 
35
46
  - name: Run tests
36
47
  run: bundle exec rspec
@@ -2,53 +2,53 @@ name: Bump version and Release
2
2
  on:
3
3
  release:
4
4
  types: [published]
5
-
5
+
6
6
  jobs:
7
7
  release:
8
8
  runs-on: ubuntu-latest
9
9
  strategy:
10
10
  fail-fast: true
11
11
 
12
- steps:
13
- - uses: actions/checkout@master
14
- with:
15
- persist-credentials: false
16
- fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
12
+ steps:
13
+ - name: Checkout source code
14
+ uses: actions/checkout@v2
15
+ with:
16
+ persist-credentials: false
17
+ fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
18
+
19
+ - name: Install required ruby version
20
+ uses: ruby/setup-ruby@v1
21
+
22
+ - name: Get version from latest tag
23
+ id: get_version
24
+ uses: battila7/get-version-action@v2
25
+
26
+ - name: Bump version
27
+ run: |
28
+ gem install -N gem-release
29
+ git config --local user.email "action@github.com"
30
+ git config --local user.name "GitHub Action"
31
+ gem bump --skip-ci --version ${{ steps.get_version.outputs.version-without-v }}
17
32
 
18
- - uses: actions/setup-ruby@v1
19
- with:
20
- ruby-version: '2.6'
21
-
22
- - name: Get version from latest tag
23
- id: get_version
24
- uses: battila7/get-version-action@v2
33
+ - name: Push changes
34
+ uses: ad-m/github-push-action@master
35
+ with:
36
+ # GitHub Actions token does not support pushing to protected branches.
37
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
38
+ #
39
+ # A manually populated`PERSONAL_ACCESS_TOKEN` environment variable
40
+ # with permissions to push to a protected branch must be used.
41
+ # not ideal - keep eyes open for a better solution
42
+ github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
25
43
 
26
- - name: Bump version
27
- run: |
28
- gem install -N gem-release
29
- git config --local user.email "action@github.com"
30
- git config --local user.name "GitHub Action"
31
- gem bump --skip-ci --version ${{ steps.get_version.outputs.version-without-v }}
32
-
33
- - name: Push changes
34
- uses: ad-m/github-push-action@master
35
- with:
36
- # GitHub Actions token does not support pushing to protected branches.
37
- # github_token: ${{ secrets.GITHUB_TOKEN }}
38
- #
39
- # A manually populated`PERSONAL_ACCESS_TOKEN` environment variable
40
- # with permissions to push to a protected branch must be used.
41
- # not ideal - keep eyes open for a better solution
42
- github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43
-
44
- - name: Release gem to rubygems.org
45
- run: |
46
- set +x
47
- mkdir -p ~/.gem
48
- cat << EOF > ~/.gem/credentials
49
- ---
50
- :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
51
- EOF
52
- chmod 0600 ~/.gem/credentials
53
- set -x
54
- gem release
44
+ - name: Release gem to rubygems.org
45
+ run: |
46
+ set +x
47
+ mkdir -p ~/.gem
48
+ cat << EOF > ~/.gem/credentials
49
+ ---
50
+ :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
51
+ EOF
52
+ chmod 0600 ~/.gem/credentials
53
+ set -x
54
+ gem release
data/.rubocop.yml CHANGED
@@ -48,7 +48,7 @@ Metrics/ClassLength:
48
48
  - app/controllers/orders_controller.rb
49
49
  - app/models/order.rb
50
50
  Metrics/BlockLength:
51
- ExcludedMethods: ['describe', 'context']
51
+ IgnoredMethods: ['describe', 'context']
52
52
  Exclude:
53
53
  - config/environments/**/**
54
54
  - Guardfile
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.6.3
1
+ ruby-2.7.2
data/Guardfile CHANGED
@@ -17,7 +17,7 @@
17
17
  #
18
18
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
19
 
20
- # Note: The cmd option is now required due to the increasing number of ways
20
+ # NOTE: The cmd option is now required due to the increasing number of ways
21
21
  # rspec may be run, below are examples of the most common uses.
22
22
  # * bundler: 'bundle exec rspec'
23
23
  # * bundler binstubs: 'bin/rspec'
data/finapps.gemspec CHANGED
@@ -20,19 +20,20 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.13'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.15'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
27
27
  spec.add_development_dependency 'guard', '~> 2.16', '>= 2.16.1'
28
28
  spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
29
29
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
30
- spec.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
31
- spec.add_development_dependency 'rubocop', '~> 0.87', '>= 0.87.0'
32
- spec.add_development_dependency 'rubocop-performance', '~> 1.7', '>= 1.7.0'
33
- spec.add_development_dependency 'rubocop-rspec', '~> 1.41', '>= 1.41.0'
34
- spec.add_development_dependency 'sinatra', '~> 2.0', '>= 2.0.8'
35
- spec.add_development_dependency 'webmock', '~> 3.8', '>= 3.8.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.10', '>= 3.10.0'
31
+ spec.add_development_dependency 'rubocop', '~> 1.9', '>= 1.9.1'
32
+ spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.2'
33
+ spec.add_development_dependency 'rubocop-rake', '~> 0.5', '>= 0.5.1'
34
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.2', '>= 2.2.0'
35
+ spec.add_development_dependency 'sinatra', '~> 2.1', '>= 2.1.0'
36
+ spec.add_development_dependency 'webmock', '~> 3.11', '>= 3.11.2'
36
37
 
37
38
  spec.extra_rdoc_files = %w[README.md LICENSE.txt]
38
39
  spec.rdoc_options = %w[--line-numbers --inline-source --title finapps-ruby --main README.md]
@@ -83,7 +83,7 @@ module FinApps
83
83
 
84
84
  def camelize(term)
85
85
  string = term.to_s
86
- string = string.sub(/^[a-z\d]*/) { $&.capitalize }
86
+ string = string.sub(/^[a-z\d]*/) { Regexp.last_match(0).capitalize }
87
87
  string.gsub(%r{(?:_|(/))([a-z\d]*)}) do
88
88
  Regexp.last_match(2).capitalize.to_s
89
89
  end
@@ -62,9 +62,9 @@ module FinApps
62
62
 
63
63
  def with_space_search(term)
64
64
  [
65
- {"email": term},
66
- {"first_name": term},
67
- {"last_name": term}
65
+ {email: term},
66
+ {first_name: term},
67
+ {last_name: term}
68
68
  ]
69
69
  end
70
70
 
@@ -72,8 +72,8 @@ module FinApps
72
72
  search_arr = []
73
73
  if /\s/.match?(term)
74
74
  term.split.each do |t|
75
- search_arr.append("first_name": t)
76
- search_arr.append("last_name": t)
75
+ search_arr.append(first_name: t)
76
+ search_arr.append(last_name: t)
77
77
  end
78
78
  end
79
79
  search_arr
@@ -95,7 +95,7 @@ module FinApps
95
95
  {"applicant.first_name": term},
96
96
  {"applicant.last_name": term},
97
97
  {
98
- "reference_no": {
98
+ reference_no: {
99
99
  "$regex": "^#{term}", "$options": 'i'
100
100
  }
101
101
  }
@@ -105,7 +105,7 @@ module FinApps
105
105
  def tag_query(tag)
106
106
  return {} unless tag
107
107
 
108
- {"tag": tag.empty? ? nil : tag}
108
+ {tag: tag.empty? ? nil : tag}
109
109
  end
110
110
 
111
111
  def status_query(status)
@@ -117,7 +117,7 @@ module FinApps
117
117
  def consumer_query(consumer)
118
118
  return {} unless consumer
119
119
 
120
- {"consumer_id": consumer.empty? ? nil : consumer}
120
+ {consumer_id: consumer.empty? ? nil : consumer}
121
121
  end
122
122
  end
123
123
  end
@@ -64,14 +64,14 @@ module FinApps
64
64
  end
65
65
 
66
66
  def search_query(term)
67
- {"last_name": term}
67
+ {last_name: term}
68
68
  end
69
69
 
70
70
  def role_query(role)
71
71
  if role.is_a?(Array)
72
- {"role": {"$in": role.map(&:to_i)}}
72
+ {role: {"$in": role.map(&:to_i)}}
73
73
  else
74
- {"role": role.to_i}
74
+ {role: role.to_i}
75
75
  end
76
76
  end
77
77
  end
@@ -81,7 +81,7 @@ module FinApps
81
81
  end
82
82
 
83
83
  def search_query_object(term)
84
- [{"public_id": {"$regex": "^#{term}", "$options": 'i'}},
84
+ [{public_id: {"$regex": "^#{term}", "$options": 'i'}},
85
85
  {"assignment.last_name": term},
86
86
  {"applicant.first_name": term},
87
87
  {"applicant.last_name": term},
@@ -95,9 +95,9 @@ module FinApps
95
95
  def status_query(status)
96
96
  if status
97
97
  if status.is_a?(Array)
98
- {"status": {"$in": status.map(&:to_i)}}
98
+ {status: {"$in": status.map(&:to_i)}}
99
99
  else
100
- {"status": status.to_i}
100
+ {status: status.to_i}
101
101
  end
102
102
  else
103
103
  {}
@@ -115,7 +115,7 @@ module FinApps
115
115
 
116
116
  def consumer_query(consumer)
117
117
  if consumer
118
- {"consumer_id": consumer.empty? ? nil : consumer}
118
+ {consumer_id: consumer.empty? ? nil : consumer}
119
119
  else
120
120
  {}
121
121
  end
@@ -125,8 +125,8 @@ module FinApps
125
125
  if !search_term && !nil_or_empty?(relation)
126
126
  {
127
127
  "$or": [
128
- {"public_id": {"$in": relation}},
129
- {"original_order_id": {"$in": relation}}
128
+ {public_id: {"$in": relation}},
129
+ {original_order_id: {"$in": relation}}
130
130
  ]
131
131
  }
132
132
  else
@@ -34,6 +34,12 @@ module FinApps
34
34
  super params, path
35
35
  end
36
36
 
37
+ def destroy(id)
38
+ not_blank(id, :session_id)
39
+
40
+ super
41
+ end
42
+
37
43
  private
38
44
 
39
45
  def build_filter(params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.47'
4
+ VERSION = '5.1.0'
5
5
  end
@@ -62,7 +62,7 @@ RSpec.describe FinApps::REST::DocumentsOrders do
62
62
  end
63
63
 
64
64
  context 'with search term containing spaces' do
65
- let(:params) { {"searchTerm": 'Blue Jay', "page": 2} }
65
+ let(:params) { {searchTerm: 'Blue Jay', page: 2} }
66
66
 
67
67
  it 'builds query and sends proper request' do
68
68
  list
@@ -174,17 +174,17 @@ RSpec.describe FinApps::REST::DocumentsOrders do
174
174
  context 'with valid params' do
175
175
  let(:params) do
176
176
  {
177
- "applicant": {
178
- "email": 'validemail@financialapps.com',
179
- "first_name": 'Emily',
180
- "last_name": 'Macs',
181
- "role": 'patient'
177
+ applicant: {
178
+ email: 'validemail@financialapps.com',
179
+ first_name: 'Emily',
180
+ last_name: 'Macs',
181
+ role: 'patient'
182
182
  },
183
- "esign_documents": [
183
+ esign_documents: [
184
184
  'temp-id'
185
185
  ],
186
- "reference_no": 'REFNO',
187
- "tag": 'new'
186
+ reference_no: 'REFNO',
187
+ tag: 'new'
188
188
  }
189
189
  end
190
190
 
@@ -200,13 +200,13 @@ RSpec.describe FinApps::REST::DocumentsOrders do
200
200
  context 'with invalid params' do
201
201
  let(:params) do
202
202
  {
203
- "applicant": {
204
- "email": 'validemail@financialapps.com',
205
- "first_name": 'Emily',
206
- "last_name": 'Macs',
207
- "role": 'patient'
203
+ applicant: {
204
+ email: 'validemail@financialapps.com',
205
+ first_name: 'Emily',
206
+ last_name: 'Macs',
207
+ role: 'patient'
208
208
  },
209
- "reference_no": 'REFNO'
209
+ reference_no: 'REFNO'
210
210
  }
211
211
  end
212
212
 
@@ -236,7 +236,7 @@ RSpec.describe FinApps::REST::DocumentsOrders do
236
236
  let(:id) { :valid_order_id }
237
237
 
238
238
  context 'with valid params' do
239
- let(:params) { {"tag": 'pending'} }
239
+ let(:params) { {tag: 'pending'} }
240
240
 
241
241
  it_behaves_like 'an API request'
242
242
  it_behaves_like 'a successful request'
@@ -244,7 +244,7 @@ RSpec.describe FinApps::REST::DocumentsOrders do
244
244
  end
245
245
 
246
246
  context 'with invalid params' do
247
- let(:params) { {"tag": 'invalid'} }
247
+ let(:params) { {tag: 'invalid'} }
248
248
 
249
249
  it_behaves_like 'an API request'
250
250
  it('results is nil') { expect(results).to be_nil }
@@ -115,10 +115,10 @@ RSpec.describe FinApps::REST::Screenings do
115
115
  context 'with valid params' do
116
116
  let(:params) do
117
117
  {
118
- "email": 'validemail@financialapps.com',
119
- "first_name": 'Geo',
120
- "last_name": 'Metric',
121
- "public_id": '1234'
118
+ email: 'validemail@financialapps.com',
119
+ first_name: 'Geo',
120
+ last_name: 'Metric',
121
+ public_id: '1234'
122
122
  }
123
123
  end
124
124
 
@@ -132,7 +132,7 @@ RSpec.describe FinApps::REST::Screenings do
132
132
  end
133
133
 
134
134
  context 'with invalid params' do
135
- let(:params) { {"params": 'invalid'} }
135
+ let(:params) { {params: 'invalid'} }
136
136
 
137
137
  it { expect { create }.not_to raise_error }
138
138
  it('results is nil') { expect(results).to be_nil }
@@ -160,7 +160,7 @@ RSpec.describe FinApps::REST::Screenings do
160
160
  let(:id) { :valid_id }
161
161
 
162
162
  context 'with valid params' do
163
- let(:params) { {"question_id": '1234'} }
163
+ let(:params) { {question_id: '1234'} }
164
164
 
165
165
  it_behaves_like 'an API request'
166
166
  it_behaves_like 'a successful request'
@@ -170,7 +170,7 @@ RSpec.describe FinApps::REST::Screenings do
170
170
  end
171
171
 
172
172
  context 'with invalid params' do
173
- let(:params) { {"question_id": 'invalid'} }
173
+ let(:params) { {question_id: 'invalid'} }
174
174
 
175
175
  it_behaves_like 'an API request'
176
176
  it('results is nil') { expect(results).to be_nil }
@@ -183,7 +183,7 @@ RSpec.describe FinApps::REST::Screenings do
183
183
 
184
184
  context 'with invalid session id' do
185
185
  let(:id) { :invalid_id }
186
- let(:params) { {"question_id": '1234'} }
186
+ let(:params) { {question_id: '1234'} }
187
187
 
188
188
  it_behaves_like 'an API request'
189
189
  it('results is nil') { expect(results).to be_nil }
@@ -195,4 +195,41 @@ RSpec.describe FinApps::REST::Screenings do
195
195
  end
196
196
  end
197
197
  end
198
+
199
+ describe '#destroy' do
200
+ subject(:destroy) { described_class.new(client).destroy(id) }
201
+
202
+ let(:results) { destroy[0] }
203
+ let(:error_messages) { destroy[1] }
204
+
205
+ context 'with valid session id' do
206
+ let(:id) { :valid_id }
207
+
208
+ it_behaves_like 'an API request'
209
+ it_behaves_like 'a successful request'
210
+ it('results is nil') { expect(results).to be_nil }
211
+ it('error_messages is empty') { expect(error_messages).to be_empty }
212
+ end
213
+
214
+ context 'when missing session id' do
215
+ let(:id) { nil }
216
+
217
+ it_behaves_like 'a request that raises an error'
218
+ end
219
+
220
+ context 'with invalid session id' do
221
+ let(:id) { :invalid_id }
222
+
223
+ it_behaves_like 'an API request'
224
+ it('results is nil') { expect(results).to be_nil }
225
+
226
+ it('error_messages is not empty') do
227
+ expect(error_messages).not_to be_empty
228
+ end
229
+
230
+ it('error messages array is populated') do
231
+ expect(error_messages.first.downcase).to eq('session not found')
232
+ end
233
+ end
234
+ end
198
235
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  require 'sinatra/base'
4
4
  require_relative 'documents_uploads_routes'
5
+ require_relative 'screenings_routes'
5
6
 
6
7
  module Fake
7
- # rubocop:disable Metrics/ClassLength
8
8
  # the FakeApi class is used to mock API requests while testing.
9
9
  class FakeApi < Sinatra::Base
10
10
  def self.version
@@ -278,33 +278,7 @@ module Fake
278
278
  get("/#{version}/documents/upload_types") { json_response 200, 'upload_types.json' }
279
279
 
280
280
  # screenings
281
- get("/#{version}/screenings") { json_response 200, 'screening_list.json' }
282
- get("/#{version}/screenings/invalid_id/resume") do
283
- json_response 404, 'resource_not_found.json'
284
- end
285
- get("/#{version}/screenings/valid_id/resume") { json_response 200, 'screening.json' }
286
- put("/#{version}/screenings/invalid_id") do
287
- json_response 404, 'resource_not_found.json'
288
- end
289
- put("/#{version}/screenings/valid_id") do
290
- request.body.rewind
291
- request_payload = JSON.parse request.body.read
292
- if request_payload['question_id'] == 'invalid'
293
- json_response 400, 'screening_invalid_update.json'
294
- else
295
- json_response 200, 'screening.json'
296
- end
297
- end
298
-
299
- post("/#{version}/screenings") do
300
- request.body.rewind
301
- request_payload = JSON.parse request.body.read
302
- if request_payload.key? 'email'
303
- json_response 201, 'screening.json'
304
- else
305
- json_response 400, 'invalid_request_body.json'
306
- end
307
- end
281
+ include ScreeningsRoutes
308
282
 
309
283
  # consumers
310
284
  get("/#{version}/consumers") do
@@ -546,5 +520,4 @@ module Fake
546
520
  File.open("#{File.dirname(__FILE__)}/fixtures/#{file_name}").read
547
521
  end
548
522
  end
549
- # rubocop:enable Metrics/ClassLength
550
523
  end
@@ -0,0 +1,5 @@
1
+ {
2
+ "messages": [
3
+ "session not found"
4
+ ]
5
+ }
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fake
4
+ module ScreeningsRoutes
5
+ class << self
6
+ def included(base)
7
+ list_routes base
8
+ resume_routes base
9
+ update_routes_invalid_id base
10
+ update_routes base
11
+ destroy_routes base
12
+ create_routes base
13
+
14
+ super
15
+ end
16
+
17
+ def list_routes(base)
18
+ base.get("/#{base.version}/screenings") do
19
+ json_response 200, 'screening_list.json'
20
+ end
21
+ end
22
+
23
+ def resume_routes(base)
24
+ base.get("/#{base.version}/screenings/invalid_id/resume") do
25
+ json_response 404, 'resource_not_found.json'
26
+ end
27
+ base.get("/#{base.version}/screenings/valid_id/resume") do
28
+ json_response 200, 'screening.json'
29
+ end
30
+ end
31
+
32
+ def update_routes_invalid_id(base)
33
+ base.put("/#{base.version}/screenings/invalid_id") do
34
+ json_response 404, 'resource_not_found.json'
35
+ end
36
+ end
37
+
38
+ def update_routes(base)
39
+ base.put("/#{base.version}/screenings/valid_id") do
40
+ request.body.rewind
41
+ request_payload = JSON.parse request.body.read
42
+ if request_payload['question_id'] == 'invalid'
43
+ json_response 400, 'screening_invalid_update.json'
44
+ else
45
+ json_response 200, 'screening.json'
46
+ end
47
+ end
48
+ end
49
+
50
+ def create_routes(base)
51
+ base.post("/#{base.version}/screenings") do
52
+ request.body.rewind
53
+ request_payload = JSON.parse request.body.read
54
+ if request_payload.key? 'email'
55
+ json_response 201, 'screening.json'
56
+ else
57
+ json_response 400, 'invalid_request_body.json'
58
+ end
59
+ end
60
+ end
61
+
62
+ def destroy_routes(base)
63
+ base.delete("/#{base.version}/screenings/:session_id") do
64
+ if params[:session_id] == 'valid_id'
65
+ status 200
66
+ else
67
+ json_response 404, 'session_not_found.json'
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
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: 5.0.47
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.0.13
22
+ version: 5.0.15
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.13
32
+ version: 5.0.15
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -134,122 +134,142 @@ dependencies:
134
134
  name: rspec
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: 3.9.0
140
137
  - - "~>"
141
138
  - !ruby/object:Gem::Version
142
- version: '3.9'
139
+ version: '3.10'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 3.10.0
143
143
  type: :development
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: 3.9.0
150
147
  - - "~>"
151
148
  - !ruby/object:Gem::Version
152
- version: '3.9'
149
+ version: '3.10'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 3.10.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 0.87.0
160
157
  - - "~>"
161
158
  - !ruby/object:Gem::Version
162
- version: '0.87'
159
+ version: '1.9'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 1.9.1
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- version: 0.87.0
170
167
  - - "~>"
171
168
  - !ruby/object:Gem::Version
172
- version: '0.87'
169
+ version: '1.9'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 1.9.1
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rubocop-performance
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: 1.7.0
180
177
  - - "~>"
181
178
  - !ruby/object:Gem::Version
182
- version: '1.7'
179
+ version: '1.9'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 1.9.2
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
+ - - "~>"
188
+ - !ruby/object:Gem::Version
189
+ version: '1.9'
187
190
  - - ">="
188
191
  - !ruby/object:Gem::Version
189
- version: 1.7.0
192
+ version: 1.9.2
193
+ - !ruby/object:Gem::Dependency
194
+ name: rubocop-rake
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
190
197
  - - "~>"
191
198
  - !ruby/object:Gem::Version
192
- version: '1.7'
199
+ version: '0.5'
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: 0.5.1
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: '0.5'
210
+ - - ">="
211
+ - !ruby/object:Gem::Version
212
+ version: 0.5.1
193
213
  - !ruby/object:Gem::Dependency
194
214
  name: rubocop-rspec
195
215
  requirement: !ruby/object:Gem::Requirement
196
216
  requirements:
197
- - - ">="
198
- - !ruby/object:Gem::Version
199
- version: 1.41.0
200
217
  - - "~>"
201
218
  - !ruby/object:Gem::Version
202
- version: '1.41'
219
+ version: '2.2'
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 2.2.0
203
223
  type: :development
204
224
  prerelease: false
205
225
  version_requirements: !ruby/object:Gem::Requirement
206
226
  requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- version: 1.41.0
210
227
  - - "~>"
211
228
  - !ruby/object:Gem::Version
212
- version: '1.41'
229
+ version: '2.2'
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: 2.2.0
213
233
  - !ruby/object:Gem::Dependency
214
234
  name: sinatra
215
235
  requirement: !ruby/object:Gem::Requirement
216
236
  requirements:
217
237
  - - "~>"
218
238
  - !ruby/object:Gem::Version
219
- version: '2.0'
239
+ version: '2.1'
220
240
  - - ">="
221
241
  - !ruby/object:Gem::Version
222
- version: 2.0.8
242
+ version: 2.1.0
223
243
  type: :development
224
244
  prerelease: false
225
245
  version_requirements: !ruby/object:Gem::Requirement
226
246
  requirements:
227
247
  - - "~>"
228
248
  - !ruby/object:Gem::Version
229
- version: '2.0'
249
+ version: '2.1'
230
250
  - - ">="
231
251
  - !ruby/object:Gem::Version
232
- version: 2.0.8
252
+ version: 2.1.0
233
253
  - !ruby/object:Gem::Dependency
234
254
  name: webmock
235
255
  requirement: !ruby/object:Gem::Requirement
236
256
  requirements:
237
- - - ">="
238
- - !ruby/object:Gem::Version
239
- version: 3.8.0
240
257
  - - "~>"
241
258
  - !ruby/object:Gem::Version
242
- version: '3.8'
259
+ version: '3.11'
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: 3.11.2
243
263
  type: :development
244
264
  prerelease: false
245
265
  version_requirements: !ruby/object:Gem::Requirement
246
266
  requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- version: 3.8.0
250
267
  - - "~>"
251
268
  - !ruby/object:Gem::Version
252
- version: '3.8'
269
+ version: '3.11'
270
+ - - ">="
271
+ - !ruby/object:Gem::Version
272
+ version: 3.11.2
253
273
  description: A simple library for communicating with the FinApps REST API.
254
274
  email:
255
275
  - erich@financialapps.com
@@ -261,7 +281,7 @@ extra_rdoc_files:
261
281
  files:
262
282
  - ".codeclimate.yml"
263
283
  - ".github/release-drafter.yml"
264
- - ".github/workflows/main.yaml"
284
+ - ".github/workflows/ci.yaml"
265
285
  - ".github/workflows/release-drafter.yml"
266
286
  - ".github/workflows/release.yml"
267
287
  - ".github/workflows/verify-pr-labeled.yml"
@@ -424,6 +444,7 @@ files:
424
444
  - spec/support/fixtures/screening.json
425
445
  - spec/support/fixtures/screening_invalid_update.json
426
446
  - spec/support/fixtures/screening_list.json
447
+ - spec/support/fixtures/session_not_found.json
427
448
  - spec/support/fixtures/sign_url.json
428
449
  - spec/support/fixtures/signed_document.pdf
429
450
  - spec/support/fixtures/single_consumer_subscribe_error.json
@@ -439,6 +460,7 @@ files:
439
460
  - spec/support/fixtures/verix/metadata.json
440
461
  - spec/support/fixtures/verix/record/create.json
441
462
  - spec/support/fixtures/verix/record/list.json
463
+ - spec/support/screenings_routes.rb
442
464
  - spec/utils/query_builder_spec.rb
443
465
  - tags
444
466
  homepage: https://github.com/finapps/ruby-client
@@ -466,55 +488,56 @@ required_rubygems_version: !ruby/object:Gem::Requirement
466
488
  - !ruby/object:Gem::Version
467
489
  version: '0'
468
490
  requirements: []
469
- rubygems_version: 3.0.3
491
+ rubygems_version: 3.1.4
470
492
  signing_key:
471
493
  specification_version: 4
472
494
  summary: FinApps REST API ruby client.
473
495
  test_files:
474
- - spec/rest/order_assignments_spec.rb
475
- - spec/rest/documents_uploads_spec.rb
476
- - spec/rest/portfolio_reports_spec.rb
477
- - spec/rest/alert_definitions_spec.rb
496
+ - spec/support/documents_uploads_routes.rb
497
+ - spec/support/screenings_routes.rb
498
+ - spec/support/fake_api.rb
499
+ - spec/spec_helpers/client.rb
500
+ - spec/rest/signed_documents_downloads_spec.rb
478
501
  - spec/rest/order_notifications_spec.rb
479
- - spec/rest/verix/verix_documents_spec.rb
480
- - spec/rest/verix/verix_records_spec.rb
481
- - spec/rest/verix/verix_metadata_spec.rb
482
- - spec/rest/verix/verix_pdf_documents_spec.rb
483
502
  - spec/rest/api_request.rb
484
- - spec/rest/documents_upload_types_spec.rb
485
- - spec/rest/portfolios_consumers_spec.rb
486
- - spec/rest/esign_templates_spec.rb
487
- - spec/rest/operators_spec.rb
488
503
  - spec/rest/sessions_spec.rb
504
+ - spec/rest/tenant_app_settings_spec.rb
505
+ - spec/rest/documents_orders_notifications_spec.rb
506
+ - spec/rest/order_refreshes_spec.rb
507
+ - spec/rest/tenant_settings_spec.rb
508
+ - spec/rest/order_statuses_spec.rb
509
+ - spec/rest/order_tokens_spec.rb
489
510
  - spec/rest/documents_orders_spec.rb
490
- - spec/rest/version_spec.rb
491
- - spec/rest/products_spec.rb
492
- - spec/rest/signed_documents_downloads_spec.rb
511
+ - spec/rest/consumers_spec.rb
512
+ - spec/rest/portfolio_reports_spec.rb
513
+ - spec/rest/alert_definitions_spec.rb
493
514
  - spec/rest/portfolios_available_consumers_spec.rb
515
+ - spec/rest/portfolios_consumers_spec.rb
516
+ - spec/rest/documents_upload_types_spec.rb
517
+ - spec/rest/esign_templates_spec.rb
518
+ - spec/rest/documents_uploads_spec.rb
519
+ - spec/rest/orders_spec.rb
520
+ - spec/rest/order_assignments_spec.rb
494
521
  - spec/rest/plaid/plaid_account_permissions_spec.rb
522
+ - spec/rest/plaid/plaid_consumer_institutions_spec.rb
495
523
  - spec/rest/plaid/plaid_accounts_spec.rb
496
524
  - spec/rest/plaid/plaid_webhooks_spec.rb
497
- - spec/rest/plaid/plaid_consumer_institutions_spec.rb
498
525
  - spec/rest/plaid/plaid_institution_logos_spec.rb
499
- - spec/rest/tenant_app_settings_spec.rb
526
+ - spec/rest/products_spec.rb
500
527
  - spec/rest/order_reports_spec.rb
501
- - spec/rest/orders_spec.rb
502
- - spec/rest/client_spec.rb
503
528
  - spec/rest/screenings_spec.rb
504
- - spec/rest/consumers_spec.rb
505
- - spec/rest/order_statuses_spec.rb
506
- - spec/rest/password_resets_spec.rb
507
- - spec/rest/documents_orders_notifications_spec.rb
508
529
  - spec/rest/alert_occurrences_spec.rb
530
+ - spec/rest/operators_spec.rb
531
+ - spec/rest/consumers_portfolios_spec.rb
532
+ - spec/rest/version_spec.rb
533
+ - spec/rest/client_spec.rb
534
+ - spec/rest/password_resets_spec.rb
509
535
  - spec/rest/portfolios_alerts_spec.rb
510
- - spec/rest/order_refreshes_spec.rb
511
- - spec/rest/tenant_settings_spec.rb
512
536
  - spec/rest/portfolios_spec.rb
513
- - spec/rest/order_tokens_spec.rb
514
- - spec/rest/consumers_portfolios_spec.rb
537
+ - spec/rest/verix/verix_pdf_documents_spec.rb
538
+ - spec/rest/verix/verix_documents_spec.rb
539
+ - spec/rest/verix/verix_records_spec.rb
540
+ - spec/rest/verix/verix_metadata_spec.rb
515
541
  - spec/rest/operators_password_resets_spec.rb
516
- - spec/support/fake_api.rb
517
- - spec/support/documents_uploads_routes.rb
518
542
  - spec/spec_helper.rb
519
543
  - spec/utils/query_builder_spec.rb
520
- - spec/spec_helpers/client.rb