checkr-official 1.5.3 → 1.7.1

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
- SHA1:
3
- metadata.gz: 11baecc2701fe8183773014e0e0ca9f742927b18
4
- data.tar.gz: 37d162612fedee47d704685bd1ffbba10687bc73
2
+ SHA256:
3
+ metadata.gz: b0ee6cb8b70cdb9316063b99aac65380b7e41d52a06d6a48c8843993c2570b9f
4
+ data.tar.gz: c4d091feae1158ea8656a2119fe0833da5088663a3cc276f4b33765546bc291f
5
5
  SHA512:
6
- metadata.gz: 719b7d97e082cf7ef6c3c1e5eee60effacd1ccbd4443c315ff5818f8db5d842e419cdec1fc18dd13ef6e5000bf650ee92e79654513b18fd3d4c8e949a91b7363
7
- data.tar.gz: f3cb6255a0affca7bd97668a636b138a13ad1327a7711149c49787b00d90e118d1c9bd05a6275209c79d52e2d4a0dc764ece24aa841e71331f8a64bd701c1e68
6
+ metadata.gz: e0893885361a9e8e647e57c91cdb7861184af8aceb9eaeeaf721e96536d0f1a76240e0ed5d1fe39268298094ae37d6e4a2089de720bf1e448a034026e22328e8
7
+ data.tar.gz: ca30bce1ec02e0f9c5dc0a0366c6bded136d48da334c5ff38e4e1f44cea2b6586a92fdcc068e14908cd9f7615624c1cc805d0ddef2faea2e63448c261ffee1d4
data/Changelog.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 1.7.1 (2021-08-31)
2
+ * Remove usage of deprecated `URI.escape`
3
+
4
+ ## 1.6.1 (2019-07-16)
5
+
6
+ Features:
7
+
8
+ - Add Adverse Action resource
9
+ - Add Adverse Item resource
10
+
11
+ ## 1.6 (2019-05-20)
12
+
13
+ - Add State Criminal Search
14
+ - Add Employment Verification
15
+
16
+ ## v1.5.4 (2018-12-10)
17
+
18
+ - Add ability to pass api key to individual API method calls
19
+
1
20
  ## v1.5.3 (2018-11-28)
2
21
 
3
22
  - Add geos to Report
@@ -16,8 +35,8 @@ Fixes:
16
35
 
17
36
  Features:
18
37
 
19
- - Add FederalCivilSearch
20
- - Add FederalCriminalSearch
38
+ - Add Federal Civil Search
39
+ - Add Federal Criminal Search
21
40
 
22
41
  ## v1.5.0 (2018-02-2)
23
42
 
data/RELEASE.md ADDED
@@ -0,0 +1,20 @@
1
+ # Releasing a new version of checkr-official
2
+
3
+ ## Release process
4
+
5
+ 1. Create a list of all the changes since the prior release
6
+ 1. Compare the latest release to master using
7
+ https://github.com/checkr/checkr-ruby/compare/`${latest}`...master
8
+ 1. Open the linked pull requests from all the `Merge pull request #...` commits
9
+ 1. For all non-documentation PRs, copy title (including pull request number)
10
+ into markdown list items
11
+ 1. Sort into logical buckets, like "New", "Improvement", "Fix"
12
+ 1. Reorganize to put the pull request number at the end of the line with author in parenthesis
13
+ 1. Ensure there are no breaking changes, or if there are breaking changes you'll need to bump
14
+ the major version, following [SemVer](https://semver.org/)
15
+ 1. Update the version
16
+ 1. Update the constant in `lib/checkr/version.rb`
17
+ 1. Commit and push to your branch
18
+ 1. Get it reviewed and merge to master
19
+ 1. Move to master branch and pull last version
20
+ 1. Run the `bin/release` script to cut a release
data/bin/release ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+ # Usage: bin/release
3
+ # Build the gem, tag master, push it to origin, and then release the package on RubyGems.
4
+
5
+ set -e
6
+
7
+ branch="$(git rev-parse --abbrev-ref HEAD)"
8
+ [ "$branch" = "master" ] ||
9
+ (echo "You are not on master. First push your branch, get your PR reviewed, merge it on Github. "\
10
+ "Then locally move to master and pull last changes." && exit 1)
11
+
12
+ version="$(gem build *.gemspec | grep Version: | awk '{print $2}')"
13
+ [ -n "$version" ] || (echo "Version needs to be a number" && exit 1)
14
+
15
+ echo $version
16
+ #git tag "v$version"
17
+ #git push origin "v$version"
18
+ gem push *-${version}.gem
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency('shoulda', '~> 3.4.0')
22
22
  s.add_development_dependency('activesupport', '~> 4.2.6')
23
23
  s.add_development_dependency('bump', '0.5.2')
24
- s.add_development_dependency('rake', '10.4.2')
24
+ s.add_development_dependency('rake', '12.3.3')
25
25
  s.add_development_dependency('test-unit')
26
26
 
27
27
  s.files = `git ls-files`.split("\n")
@@ -0,0 +1,23 @@
1
+ module Checkr
2
+ class AdverseAction < APIResource
3
+ attribute :status
4
+ attribute :report_id
5
+ attribute :post_notice_scheduled_at
6
+ attribute :post_notice_ready_at
7
+ attribute :canceled_at
8
+ attribute :individualized_assessment_engaged
9
+ attribute :adverse_items, APIList.constructor(:AdverseItem)
10
+
11
+ api_class_method :create, :post, '/v1/reports/:report_id/adverse_actions'
12
+ api_class_method :retrieve, :get, ':path/:id', :arguments => [:id]
13
+ api_class_method :cancel, :delete, ':path/:id', :arguments => [:id]
14
+
15
+ api_instance_method :cancel, :delete
16
+
17
+ def self.path
18
+ '/v1/adverse_actions'
19
+ end
20
+
21
+ APIClass.register_subclass(self, 'adverse_action')
22
+ end
23
+ end
@@ -0,0 +1,9 @@
1
+ module Checkr
2
+ class AdverseItem < APIResource
3
+ attribute :text
4
+
5
+ api_class_method :all, :get, '/v1/reports/:report_id/adverse_items', :constructor => :AdverseItemList
6
+
7
+ APIClass.register_subclass(self, 'adverse_item')
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ module Checkr
2
+ class AdverseItemList < APIList
3
+
4
+ attribute :next_href
5
+ attribute :previous_href
6
+ attribute :count
7
+ attr_accessor :parent
8
+
9
+ api_instance_method :all, :get
10
+
11
+ def self.construct(json, parent=nil)
12
+ lambda = constructor(:AdverseItem)
13
+ instance = lambda.call(json)
14
+ instance.parent = parent if parent
15
+ instance.clear_changed_attributes
16
+ instance
17
+ end
18
+
19
+ def path
20
+ parent.path + '/adverse_items'
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ module Checkr
2
+ class EmploymentVerification < APIResource
3
+
4
+ attribute :status
5
+ attribute :completed_at
6
+ attribute :turnaround_time
7
+ attribute :records
8
+
9
+ api_class_method :retrieve, :get, ':path/:id', arguments: [:id]
10
+
11
+ def self.path
12
+ '/v1/employment_verifications'
13
+ end
14
+
15
+ APIClass.register_subclass(self, 'employment_verification')
16
+
17
+ end
18
+ end
data/lib/checkr/report.rb CHANGED
@@ -11,6 +11,9 @@ module Checkr
11
11
  attribute :candidate, :Candidate
12
12
  attribute_writer_alias :candidate_id, :candidate
13
13
 
14
+ attribute :adverse_items, :AdverseItemList, :nested => true, :default => {}
15
+ attribute_writer_alias :adverse_item_ids, :adverse_items
16
+
14
17
  attribute :ssn_trace, :SSNTrace
15
18
  attribute_writer_alias :ssn_trace_id, :ssn_trace
16
19
 
@@ -29,6 +32,9 @@ module Checkr
29
32
  attribute :county_criminal_searches, APIList.constructor(:CountyCriminalSearch)
30
33
  attribute_writer_alias :county_criminal_search_ids, :county_criminal_searches
31
34
 
35
+ attribute :state_criminal_searches, APIList.constructor(:StateCriminalSearch)
36
+ attribute_writer_alias :state_criminal_search_ids, :state_criminal_searches
37
+
32
38
  attribute :federal_criminal_search, :FederalCriminalSearch
33
39
  attribute_writer_alias :federal_criminal_search_ids, :federal_criminal_search
34
40
 
@@ -50,6 +56,9 @@ module Checkr
50
56
  attribute :education_verification, :EducationVerification
51
57
  attribute_writer_alias :education_verification_id, :education_verification
52
58
 
59
+ attribute :employment_verification, :EmploymentVerification
60
+ attribute_writer_alias :employment_verification_id, :employment_verification
61
+
53
62
  api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
54
63
  api_class_method :create, :post
55
64
 
@@ -0,0 +1,22 @@
1
+ module Checkr
2
+ class StateCriminalSearch < APIResource
3
+
4
+ attribute :status
5
+ attribute :completed_at
6
+ attribute :turnaround_time
7
+ attribute :state
8
+ attribute :records
9
+ attribute :filtered_by_positive_adjudication_records
10
+ attribute :estimated_completion_date
11
+ attribute :estimated_completion_time
12
+
13
+ api_class_method :retrieve, :get, ':path/:id', arguments: [:id]
14
+
15
+ def self.path
16
+ '/v1/state_criminal_searches'
17
+ end
18
+
19
+ APIClass.register_subclass(self, 'state_criminal_search')
20
+
21
+ end
22
+ end
data/lib/checkr/util.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  module Checkr
2
4
  module Util
3
5
 
@@ -38,7 +40,7 @@ module Checkr
38
40
  end
39
41
 
40
42
  def self.escape(val)
41
- URI.escape(val.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
43
+ ERB::Util.url_encode(val.to_s)
42
44
  end
43
45
 
44
46
  def self.symbolize_keys(obj)
@@ -1,3 +1,3 @@
1
1
  module Checkr
2
- VERSION = '1.5.3'.freeze
2
+ VERSION = '1.7.1'.freeze
3
3
  end
data/lib/checkr.rb CHANGED
@@ -18,11 +18,15 @@ require 'checkr/api_list'
18
18
  require 'checkr/util'
19
19
 
20
20
  # Requires for classes
21
+ require 'checkr/adverse_action'
22
+ require 'checkr/adverse_item'
23
+ require 'checkr/adverse_item_list'
21
24
  require 'checkr/candidate'
22
25
  require 'checkr/county_criminal_search'
23
26
  require 'checkr/document'
24
27
  require 'checkr/document_list'
25
28
  require 'checkr/education_verification'
29
+ require 'checkr/employment_verification'
26
30
  require 'checkr/eviction_search'
27
31
  require 'checkr/federal_civil_search'
28
32
  require 'checkr/federal_criminal_search'
@@ -37,6 +41,7 @@ require 'checkr/report'
37
41
  require 'checkr/report_list'
38
42
  require 'checkr/sex_offender_search'
39
43
  require 'checkr/ssn_trace'
44
+ require 'checkr/state_criminal_search'
40
45
  require 'checkr/subscription'
41
46
  require 'checkr/verification'
42
47
  require 'checkr/verification_list'
@@ -61,6 +66,9 @@ module Checkr
61
66
  end
62
67
 
63
68
  def self.request(method, path, params={}, headers={})
69
+ api_key = params[:api_key] || self.api_key
70
+ params.delete(:api_key)
71
+
64
72
  verify_api_key(api_key)
65
73
 
66
74
  url = api_url(path)
@@ -0,0 +1,59 @@
1
+ # State Criminal Search
2
+
3
+ ## The State Criminal Search Object
4
+
5
+ ### Example Response
6
+
7
+ ```ruby
8
+ #<Checkr::StateCriminalSearch:0x3fd909bcd974 id=539fdcf335644a0ef4000001> JSON: {
9
+ "status": "pending",
10
+ "completed_at": "2019-05-14T19:43:32Z",
11
+ "turnaround_time": 455685,
12
+ "state": "CA",
13
+ "records": [],
14
+ "id": "539fdcf335644a0ef4000001",
15
+ "object": "test_state_criminal_search",
16
+ "uri": "/v1/state_criminal_searches/539fdcf335644a0ef4000001",
17
+ "created_at": "2014-06-17T06:15:47Z",
18
+ "estimated_completion_time": "2019-05-09T21:40:45Z",
19
+ "estimated_completion_date": "2019-05-10",
20
+ "filtered_by_positive_adjudication_records": []
21
+ }
22
+ ```
23
+
24
+
25
+ ## Retrieve an existing State Criminal Search
26
+
27
+ ### Definition
28
+
29
+ ```ruby
30
+ Checkr::StateCriminalSearch.retrieve({STATE_CRIMINAL_SEARCH_ID})
31
+ ```
32
+
33
+ ### Example Request
34
+
35
+ ```ruby
36
+ require 'checkr' # Note the gem is named checkr-official
37
+ Checkr.api_key = "83ebeabdec09f6670863766f792ead24d61fe3f9"
38
+
39
+ ccs = Checkr::StateCriminalSearch.retrieve("539fdcf335644a0ef4000001")
40
+ ```
41
+
42
+ ### Example Response
43
+
44
+ ```ruby
45
+ #<Checkr::StateCriminalSearch:0x3fd909bcd974 id=539fdcf335644a0ef4000001> JSON: {
46
+ "status": "pending",
47
+ "completed_at": "2019-05-14T19:43:32Z",
48
+ "turnaround_time": 455685,
49
+ "state": "CA",
50
+ "records": [],
51
+ "id": "539fdcf335644a0ef4000001",
52
+ "object": "test_state_criminal_search",
53
+ "uri": "/v1/state_criminal_searches/539fdcf335644a0ef4000001",
54
+ "created_at": "2014-06-17T06:15:47Z",
55
+ "estimated_completion_time": "2019-05-09T21:40:45Z",
56
+ "estimated_completion_date": "2019-05-10",
57
+ "filtered_by_positive_adjudication_records": []
58
+ }
59
+ ```
@@ -0,0 +1,91 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ module Checkr
4
+ class AdverseActionTest < Test::Unit::TestCase
5
+ setup do
6
+ @adverse_action_url = "#{Checkr.api_base}#{AdverseAction.path}"
7
+ end
8
+
9
+ should 'be registered' do
10
+ assert(APIClass.subclasses.include?(AdverseAction))
11
+ assert_equal(AdverseAction, APIClass.subclass_fetch('adverse_action'))
12
+ end
13
+
14
+ context 'Constructed AdverseAction instance' do
15
+ setup do
16
+ @adverse_action = AdverseAction.construct(test_adverse_action)
17
+ end
18
+
19
+ [
20
+ :id,
21
+ :object,
22
+ :uri,
23
+ :created_at,
24
+ :status,
25
+ :report_id,
26
+ :post_notice_scheduled_at,
27
+ :post_notice_ready_at,
28
+ :canceled_at,
29
+ :individualized_assessment_engaged,
30
+ ].each do |attribute|
31
+ should "have the #{attribute.to_s} attribute" do
32
+ assert_equal(test_adverse_action[attribute], @adverse_action.public_send(attribute))
33
+ end
34
+ end
35
+ end
36
+
37
+ context '.create' do
38
+ setup do
39
+ @report = Report.construct(test_report)
40
+ @create_url = "#{Checkr.api_base}#{Report.path}/#{@report.id}/adverse_actions"
41
+ end
42
+
43
+ should 'creates an instance of AdverseAction' do
44
+ @mock.expects(:post).once.with(@create_url, anything, anything)
45
+ .returns(test_response(test_adverse_action))
46
+
47
+ adverse_action = AdverseAction.create({ :report_id => @report.id })
48
+
49
+ assert(adverse_action.is_a?(AdverseAction))
50
+ assert_equal(test_adverse_action[:id], adverse_action.id)
51
+ end
52
+ end
53
+
54
+ context '.retrieve' do
55
+ setup do
56
+ @id = test_adverse_action[:id]
57
+ @retrieve_url = "#{Checkr.api_base}#{AdverseAction.path}/#{@id}"
58
+ end
59
+
60
+ should 'fetches an instance of AdverseAction' do
61
+ @mock.expects(:get).once.with(@retrieve_url, anything, anything)
62
+ .returns(test_response(test_adverse_action))
63
+
64
+ adverse_action = AdverseAction.retrieve(@id)
65
+
66
+ assert(adverse_action.is_a?(AdverseAction))
67
+ assert_equal(@id, adverse_action.id)
68
+ end
69
+ end
70
+
71
+ context '#cancel/.cancel' do
72
+ setup do
73
+ @id = test_adverse_action[:id]
74
+ @cancel_url = "#{Checkr.api_base}#{AdverseAction.path}/#{@id}"
75
+ end
76
+
77
+ should 'cancels an instance of AdverseAction' do
78
+ @mock.expects(:delete).twice.with(@cancel_url, anything, anything)
79
+ .returns(test_response(test_adverse_action))
80
+
81
+ adverse_action = AdverseAction.cancel(@id)
82
+ assert(adverse_action.is_a?(AdverseAction))
83
+ assert_equal(@id, adverse_action.id)
84
+
85
+ adverse_action = AdverseAction.new(@id).cancel
86
+ assert(adverse_action.is_a?(AdverseAction))
87
+ assert_equal(@id, adverse_action.id)
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,49 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ module Checkr
4
+ class AdverseItemTest < Test::Unit::TestCase
5
+ setup do
6
+ @report = Report.construct(test_report)
7
+ @adverse_item_url = "#{Checkr.api_base}#{@report.path}/adverse_items"
8
+ end
9
+
10
+ context 'Constructed AdverseItem instance' do
11
+ setup do
12
+ @adverse_item = AdverseItem.construct(test_adverse_item)
13
+ end
14
+
15
+ [
16
+ :id,
17
+ :object,
18
+ :uri,
19
+ :created_at,
20
+ :text,
21
+ ].each do |attribute|
22
+ should "have the #{attribute.to_s} attribute" do
23
+ assert_equal(test_adverse_item[attribute], @adverse_item.public_send(attribute))
24
+ end
25
+ end
26
+ end
27
+
28
+ context '.all' do
29
+ should 'return instances of AdverseItem' do
30
+ @mock.expects(:get).once.with do |url, params, opts|
31
+ url.start_with?(@adverse_item_url)
32
+ end.returns(test_response(test_adverse_item_list))
33
+
34
+ adverse_items = AdverseItem.all({ :report_id => @report.id })
35
+
36
+ assert(adverse_items.is_a?(AdverseItemList))
37
+ assert(adverse_items.length > 0)
38
+ adverse_items.each do |adverse_item|
39
+ assert(adverse_item.is_a?(AdverseItem))
40
+ end
41
+ end
42
+ end
43
+
44
+ should 'be registered' do
45
+ assert(APIClass.subclasses.include?(AdverseItem))
46
+ assert_equal(AdverseItem, APIClass.subclass_fetch('adverse_item'))
47
+ end
48
+ end
49
+ end
@@ -48,6 +48,47 @@ module Checkr
48
48
  :filter => 'test filter',
49
49
  })
50
50
  end
51
+
52
+ should 'allow passing an api_key as a param when the global api_key is set' do
53
+ response = test_response(test_mock_resource_list)
54
+ api_key = '123456'
55
+
56
+ @mock.expects(:get).with do |url, headers, params|
57
+ (url == "#{Checkr.api_base}#{MockResource.path}?page=1&filter=test%20filter" ||
58
+ url == "#{Checkr.api_base}#{MockResource.path}?filter=test%20filter&page=1") &&
59
+ params == nil &&
60
+ Checkr.api_key == 'foo'
61
+ headers["Authorization"] == "Basic #{Base64.encode64("#{api_key}:")}"
62
+ end.returns(response)
63
+
64
+ list = MockResource.all(
65
+ :page => 1,
66
+ :filter => 'test filter',
67
+ :api_key => api_key
68
+ )
69
+ end
70
+
71
+ should 'allow passing an api_key as a param when the global api_key is NOT set' do
72
+ response = test_response(test_mock_resource_list)
73
+ api_key = '123456'
74
+ Checkr.api_key = nil
75
+
76
+
77
+ @mock.expects(:get).with do |url, headers, params|
78
+ (url == "#{Checkr.api_base}#{MockResource.path}?page=1&filter=test%20filter" ||
79
+ url == "#{Checkr.api_base}#{MockResource.path}?filter=test%20filter&page=1") &&
80
+ params == nil &&
81
+ headers["Authorization"] == "Basic #{Base64.encode64("#{api_key}:")}"
82
+ end.returns(response)
83
+
84
+ assert_equal(Checkr.api_key, nil)
85
+
86
+ list = MockResource.all(
87
+ :page => 1,
88
+ :filter => 'test filter',
89
+ :api_key => api_key
90
+ )
91
+ end
51
92
  end
52
93
 
53
94
  context 'Making a DELETE request' do
@@ -60,6 +101,19 @@ module Checkr
60
101
  end.returns(test_response({}))
61
102
  mock_resource.delete(:reason => "delinquent payments")
62
103
  end
104
+
105
+ should 'allow passing an api_key as a param' do
106
+ api_key = '123456'
107
+
108
+ @mock.expects(:get).once.returns(test_response(test_mock_resource))
109
+ mock_resource = MockResource.retrieve("fake_id")
110
+
111
+ @mock.expects(:delete).once.with do |url, headers, payload|
112
+ url == "#{Checkr.api_base}#{mock_resource.path}?reason=delinquent%20payments" && payload.nil? &&
113
+ headers["Authorization"] == "Basic #{Base64.encode64("#{api_key}:")}"
114
+ end.returns(test_response({}))
115
+ mock_resource.delete(:reason => "delinquent payments", :api_key => api_key)
116
+ end
63
117
  end
64
118
 
65
119
  context 'Making a PUT request' do
@@ -73,6 +127,20 @@ module Checkr
73
127
  end.returns(test_response(test_mock_resource))
74
128
  mock_resource.save
75
129
  end
130
+
131
+ should 'allow passing an api_key as a param' do
132
+ api_key = '123456'
133
+
134
+ @mock.expects(:get).once.returns(test_response(test_mock_resource))
135
+ mock_resource = MockResource.retrieve("fake_id")
136
+ mock_resource.name = "new name"
137
+
138
+ @mock.expects(:put).once.with do |url, headers, payload|
139
+ payload == { :name => "new name"} &&
140
+ headers["Authorization"] == "Basic #{Base64.encode64("#{api_key}:")}"
141
+ end.returns(test_response(test_mock_resource))
142
+ mock_resource.save(:api_key => api_key)
143
+ end
76
144
  end
77
145
 
78
146
  context 'Making a POST request' do
@@ -82,6 +150,17 @@ module Checkr
82
150
 
83
151
  MockResource.create(params)
84
152
  end
153
+
154
+ should 'allow passing an api_key as a param' do
155
+ api_key = '123456'
156
+
157
+ @mock.expects(:post).once.with do |url, headers, payload|
158
+ url == "#{Checkr.api_base}#{MockResource.path}" && payload == { :name => "some name" } &&
159
+ headers["Authorization"] == "Basic #{Base64.encode64("#{api_key}:")}"
160
+ end.returns(test_response(test_mock_resource))
161
+
162
+ MockResource.create(:name => "some name", :api_key => api_key)
163
+ end
85
164
  end
86
165
 
87
166
  context 'APIClass :default_params' do
@@ -0,0 +1,80 @@
1
+ require File.expand_path('../test_helper', __dir__)
2
+
3
+ module Checkr
4
+ class EmploymentVerificationTest < Test::Unit::TestCase
5
+
6
+ setup do
7
+ @employment_verification_url = "#{Checkr.api_base}/v1/employment_verifications"
8
+ end
9
+
10
+ context 'EmploymentVerification class' do
11
+ should 'be retrieveable' do
12
+ id = 'employment_verification_id'
13
+ @mock.expects(:get).once.with("#{@employment_verification_url}/#{id}", anything, anything)
14
+ .returns(test_response(test_employment_verification))
15
+ employment_verification = EmploymentVerification.retrieve(id)
16
+ assert(employment_verification.is_a?(EmploymentVerification))
17
+ end
18
+ end
19
+
20
+ context 'EmploymentVerification instance' do
21
+ should 'be refreshable' do
22
+ @mock.expects(:get).once
23
+ .with("#{@employment_verification_url}/#{test_employment_verification[:id]}",
24
+ anything, anything)
25
+ .returns(test_response(test_employment_verification))
26
+ employment_verification = EmploymentVerification.new(test_employment_verification[:id])
27
+ employment_verification.refresh
28
+ assert_equal(test_employment_verification[:status], employment_verification.status)
29
+ end
30
+ end
31
+
32
+ context 'Retrieved EmploymentVerification instance' do
33
+ setup do
34
+ @mock.expects(:get).once.returns(test_response(test_employment_verification))
35
+ @employment_verification = EmploymentVerification.retrieve('employment_verification_id')
36
+ end
37
+
38
+ should 'have the id attribute' do
39
+ assert_equal(test_employment_verification[:id], @employment_verification.id)
40
+ end
41
+
42
+ should 'have the object attribute' do
43
+ assert_equal(test_employment_verification[:object], @employment_verification.object)
44
+ end
45
+
46
+ should 'have the uri attribute' do
47
+ assert_equal(test_employment_verification[:uri], @employment_verification.uri)
48
+ end
49
+
50
+ should 'have the status attribute' do
51
+ assert_equal(test_employment_verification[:status], @employment_verification.status)
52
+ end
53
+
54
+ should 'have the created_at attribute' do
55
+ assert_equal(test_employment_verification[:created_at],
56
+ @employment_verification.created_at)
57
+ end
58
+
59
+ should 'have the completed_at attribute' do
60
+ assert_equal(test_employment_verification[:completed_at],
61
+ @employment_verification.completed_at)
62
+ end
63
+
64
+ should 'have the turnaround_time attribute' do
65
+ assert_equal(test_employment_verification[:turnaround_time],
66
+ @employment_verification.turnaround_time)
67
+ end
68
+
69
+ should 'have the records attribute' do
70
+ assert_equal(test_employment_verification[:records], @employment_verification.records)
71
+ end
72
+ end
73
+
74
+ should 'be registered' do
75
+ assert(APIClass.subclasses.include?(EmploymentVerification))
76
+ assert_equal(EmploymentVerification, APIClass.subclass_fetch('employment_verification'))
77
+ end
78
+
79
+ end
80
+ end
@@ -0,0 +1,82 @@
1
+ require File.expand_path('../test_helper', __dir__)
2
+
3
+ module Checkr
4
+ class StateCriminalSearchTest < Test::Unit::TestCase
5
+
6
+ setup do
7
+ @state_criminal_search_url = "#{Checkr.api_base}/v1/state_criminal_searches"
8
+ end
9
+
10
+ context 'StateCriminalSearch class' do
11
+ should 'be retrieveable' do
12
+ id = 'state_criminal_search_id'
13
+ @mock.expects(:get).once.with("#{@state_criminal_search_url}/#{id}", anything, anything)
14
+ .returns(test_response(test_state_criminal_search))
15
+ state_criminal_search = StateCriminalSearch.retrieve(id)
16
+ assert(state_criminal_search.is_a?(StateCriminalSearch))
17
+ end
18
+ end
19
+
20
+ context 'StateCriminalSearch instance' do
21
+ should 'be refreshable' do
22
+ @mock.expects(:get).once
23
+ .with("#{@state_criminal_search_url}/#{test_state_criminal_search[:id]}",
24
+ anything, anything)
25
+ .returns(test_response(test_state_criminal_search))
26
+ state_criminal_search = StateCriminalSearch.new(test_state_criminal_search[:id])
27
+ state_criminal_search.refresh
28
+ assert_equal(test_state_criminal_search[:status], state_criminal_search.status)
29
+ end
30
+ end
31
+
32
+ context 'Retrieved StateCriminalSearch instance' do
33
+ setup do
34
+ @mock.expects(:get).once.returns(test_response(test_state_criminal_search))
35
+ @state_criminal_search = StateCriminalSearch.retrieve('state_criminal_search_id')
36
+ end
37
+
38
+ should 'have the id attribute' do
39
+ assert_equal(test_state_criminal_search[:id], @state_criminal_search.id)
40
+ end
41
+
42
+ should 'have the object attribute' do
43
+ assert_equal(test_state_criminal_search[:object], @state_criminal_search.object)
44
+ end
45
+
46
+ should 'have the uri attribute' do
47
+ assert_equal(test_state_criminal_search[:uri], @state_criminal_search.uri)
48
+ end
49
+
50
+ should 'have the status attribute' do
51
+ assert_equal(test_state_criminal_search[:status], @state_criminal_search.status)
52
+ end
53
+
54
+ should 'have the created_at attribute' do
55
+ assert_equal(test_state_criminal_search[:created_at], @state_criminal_search.created_at)
56
+ end
57
+
58
+ should 'have the completed_at attribute' do
59
+ assert_equal(test_state_criminal_search[:completed_at], @state_criminal_search.completed_at)
60
+ end
61
+
62
+ should 'have the turnaround_time attribute' do
63
+ assert_equal(test_state_criminal_search[:turnaround_time],
64
+ @state_criminal_search.turnaround_time)
65
+ end
66
+
67
+ should 'have the state attribute' do
68
+ assert_equal(test_state_criminal_search[:state], @state_criminal_search.state)
69
+ end
70
+
71
+ should 'have the records attribute' do
72
+ assert_equal(test_state_criminal_search[:records], @state_criminal_search.records)
73
+ end
74
+ end
75
+
76
+ should 'be registered' do
77
+ assert(APIClass.subclasses.include?(StateCriminalSearch))
78
+ assert_equal(StateCriminalSearch, APIClass.subclass_fetch('state_criminal_search'))
79
+ end
80
+
81
+ end
82
+ end
data/test/test_data.rb CHANGED
@@ -380,6 +380,22 @@ module Checkr
380
380
  :disposition_date=>"2011-06-02"}]}]}
381
381
  end
382
382
 
383
+ def test_state_criminal_search
384
+ { id: "5cd4265fd46fcf0001c6b8f3",
385
+ object: "state_criminal_search",
386
+ uri: "/v1/state_criminal_searches/5cd4265fd46fcf0001c6b8f3",
387
+ status: "clear",
388
+ state: "NY",
389
+ created_at: "2019-05-09T13:08:47Z",
390
+ completed_at: "2019-05-14T19:43:32Z",
391
+ turnaround_time: 455685,
392
+ estimated_completion_time: "2019-05-09T21:40:45Z",
393
+ estimated_completion_date: "2019-05-10",
394
+ records: [],
395
+ filtered_by_positive_adjudication_records: []
396
+ }
397
+ end
398
+
383
399
  def test_invitation
384
400
  { id: '2c8447d8c35761ad8f70d9d3',
385
401
  status: 'pending',
@@ -497,6 +513,7 @@ module Checkr
497
513
  :type=>"driver_license",
498
514
  :content_type=>"image/jpeg"}
499
515
  end
516
+
500
517
  def test_document_list
501
518
  {
502
519
  :object => 'list',
@@ -512,6 +529,7 @@ module Checkr
512
529
  :verification_url=>"http://verifications.checkr.com/db313e73383710d4fa2f18fd",
513
530
  :completed_at=>nil}
514
531
  end
532
+
515
533
  def test_verification_list
516
534
  {
517
535
  :object => 'list',
@@ -519,6 +537,46 @@ module Checkr
519
537
  }
520
538
  end
521
539
 
540
+ def test_adverse_item
541
+ {
542
+ :id => '71c0c2c79349c9f899bda22d3ccf60b7e0469266',
543
+ :object => 'adverse_item',
544
+ :text => 'License status: Suspended',
545
+ }
546
+ end
547
+
548
+ def test_adverse_item_list
549
+ {
550
+ :object => 'list',
551
+ :count => 2,
552
+ :data => [test_adverse_item, test_adverse_item],
553
+ }
554
+ end
555
+
556
+ def test_adverse_action
557
+ {
558
+ :id => '5d0af2cdfccff00034be49e9',
559
+ :object => 'adverse_action',
560
+ :uri => '/v1/adverse_actions/5d0af2cdfccff00034be49e9',
561
+ :created_at => '2019-06-20T02:43:25Z',
562
+ :status => 'pending',
563
+ :report_id => 'd36abda710bde8fd2c9d2587',
564
+ :post_notice_scheduled_at => '2019-06-27T02:43:25Z',
565
+ :post_notice_ready_at => '2019-06-27T02:43:25Z',
566
+ :canceled_at => nil,
567
+ :individualized_assessment_engaged => false,
568
+ :adverse_items => test_adverse_item_list,
569
+ }
570
+ end
571
+
572
+ def test_adverse_action_list
573
+ {
574
+ :object => 'list',
575
+ :count => 2,
576
+ :data => [test_adverse_action, test_adverse_action],
577
+ }
578
+ end
579
+
522
580
  def test_education_verification
523
581
  {:id => "5af5e030d24297006cce1e06",
524
582
  :object => "education_verification",
@@ -530,6 +588,17 @@ module Checkr
530
588
  :records => []}
531
589
  end
532
590
 
591
+ def test_employment_verification
592
+ { id: "5cd42657682ee80028cece4c",
593
+ object: "employment_verification",
594
+ uri: "/v1/employment_verifications/5cd42657682ee80028cece4c",
595
+ status: "clear",
596
+ created_at: "2019-05-09T13:08:39Z",
597
+ completed_at: "2019-05-13T12:50:47Z",
598
+ turnaround_time: 344528,
599
+ records: [] }
600
+ end
601
+
533
602
  # Errors
534
603
  def test_api_error
535
604
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkr-official
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Checkr Engineering Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-29 00:00:00.000000000 Z
11
+ date: 2021-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 10.4.2
103
+ version: 12.3.3
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 10.4.2
110
+ version: 12.3.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: test-unit
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,7 @@ email:
128
128
  - eng@checkr.com
129
129
  executables:
130
130
  - checkr-console
131
+ - release
131
132
  extensions: []
132
133
  extra_rdoc_files: []
133
134
  files:
@@ -138,10 +139,15 @@ files:
138
139
  - Gemfile
139
140
  - LICENSE
140
141
  - README.md
142
+ - RELEASE.md
141
143
  - Rakefile
142
144
  - bin/checkr-console
145
+ - bin/release
143
146
  - checkr-official.gemspec
144
147
  - lib/checkr.rb
148
+ - lib/checkr/adverse_action.rb
149
+ - lib/checkr/adverse_item.rb
150
+ - lib/checkr/adverse_item_list.rb
145
151
  - lib/checkr/api_class.rb
146
152
  - lib/checkr/api_list.rb
147
153
  - lib/checkr/api_resource.rb
@@ -151,6 +157,7 @@ files:
151
157
  - lib/checkr/document.rb
152
158
  - lib/checkr/document_list.rb
153
159
  - lib/checkr/education_verification.rb
160
+ - lib/checkr/employment_verification.rb
154
161
  - lib/checkr/errors/api_connection_error.rb
155
162
  - lib/checkr/errors/api_error.rb
156
163
  - lib/checkr/errors/authentication_error.rb
@@ -171,6 +178,7 @@ files:
171
178
  - lib/checkr/screening.rb
172
179
  - lib/checkr/sex_offender_search.rb
173
180
  - lib/checkr/ssn_trace.rb
181
+ - lib/checkr/state_criminal_search.rb
174
182
  - lib/checkr/subscription.rb
175
183
  - lib/checkr/util.rb
176
184
  - lib/checkr/verification.rb
@@ -178,7 +186,7 @@ files:
178
186
  - lib/checkr/version.rb
179
187
  - mclovin.jpg
180
188
  - samples/candidate.md
181
- - samples/country_criminal_search.md
189
+ - samples/county_criminal_search.md
182
190
  - samples/document.md
183
191
  - samples/geo.md
184
192
  - samples/global_watchlist_search.md
@@ -188,8 +196,11 @@ files:
188
196
  - samples/report.md
189
197
  - samples/sex_offender_search.md
190
198
  - samples/ssn_trace.md
199
+ - samples/state_criminal_search.md
191
200
  - samples/subscription.md
192
201
  - tasks/api_test.rb
202
+ - test/checkr/adverse_action_test.rb
203
+ - test/checkr/adverse_item_test.rb
193
204
  - test/checkr/api_class_test.rb
194
205
  - test/checkr/api_list_test.rb
195
206
  - test/checkr/api_resource_test.rb
@@ -200,6 +211,7 @@ files:
200
211
  - test/checkr/document_list_test.rb
201
212
  - test/checkr/document_test.rb
202
213
  - test/checkr/education_verification_test.rb
214
+ - test/checkr/employment_verification_test.rb
203
215
  - test/checkr/eviction_search_test.rb
204
216
  - test/checkr/federal_civil_search_test.rb
205
217
  - test/checkr/federal_criminal_search_test.rb
@@ -213,6 +225,7 @@ files:
213
225
  - test/checkr/report_test.rb
214
226
  - test/checkr/sex_offender_search_test.rb
215
227
  - test/checkr/ssn_trace_test.rb
228
+ - test/checkr/state_criminal_search_test.rb
216
229
  - test/checkr/status_codes_test.rb
217
230
  - test/checkr/subscription_test.rb
218
231
  - test/checkr/util_test.rb
@@ -225,7 +238,7 @@ homepage: https://checkr.com/
225
238
  licenses:
226
239
  - Apache-2.0
227
240
  metadata: {}
228
- post_install_message:
241
+ post_install_message:
229
242
  rdoc_options: []
230
243
  require_paths:
231
244
  - lib
@@ -240,12 +253,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
253
  - !ruby/object:Gem::Version
241
254
  version: '0'
242
255
  requirements: []
243
- rubyforge_project:
244
- rubygems_version: 2.5.2.3
245
- signing_key:
256
+ rubygems_version: 3.0.3
257
+ signing_key:
246
258
  specification_version: 4
247
259
  summary: Ruby bindings for Checkr API
248
260
  test_files:
261
+ - test/checkr/adverse_action_test.rb
262
+ - test/checkr/adverse_item_test.rb
249
263
  - test/checkr/api_class_test.rb
250
264
  - test/checkr/api_list_test.rb
251
265
  - test/checkr/api_resource_test.rb
@@ -256,6 +270,7 @@ test_files:
256
270
  - test/checkr/document_list_test.rb
257
271
  - test/checkr/document_test.rb
258
272
  - test/checkr/education_verification_test.rb
273
+ - test/checkr/employment_verification_test.rb
259
274
  - test/checkr/eviction_search_test.rb
260
275
  - test/checkr/federal_civil_search_test.rb
261
276
  - test/checkr/federal_criminal_search_test.rb
@@ -269,6 +284,7 @@ test_files:
269
284
  - test/checkr/report_test.rb
270
285
  - test/checkr/sex_offender_search_test.rb
271
286
  - test/checkr/ssn_trace_test.rb
287
+ - test/checkr/state_criminal_search_test.rb
272
288
  - test/checkr/status_codes_test.rb
273
289
  - test/checkr/subscription_test.rb
274
290
  - test/checkr/util_test.rb