checkr-official 1.1.2 → 1.2.0

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: e160c7bd357550623cb71709142c66b23920d645
4
- data.tar.gz: 5be13eaea8677719e1932ae6fa0248cdbf3a3b33
3
+ metadata.gz: 3f6f8e7728235f664dd469823cba36fb43579c62
4
+ data.tar.gz: ce422753b6aa3970255925acd63e842289bad87d
5
5
  SHA512:
6
- metadata.gz: d13cfed1b9ae41f54f219b3f9be54599917369dd78a0a8f4763b33b8c14a5fdc13aa375015a4156be82d929f1372f74fc304dab015779d23d36c671aed433e0d
7
- data.tar.gz: 3d3fca9ae636b4eaed8fc06334d20f282be60aeecd3c0b3c5020ae220c05d02ea00fb0caec979aa402d08befcbed7ad6923339a81d72d727a6aed89661e761ef
6
+ metadata.gz: 00b977c5fda42d85f1ebcdeea088499c8ee462c74148d15639d953eea6e6e7ffc19ababc88c544dd1fcb72aab82c1de4460b707ca674360e2c74de681af51feb
7
+ data.tar.gz: b2795ecaf64392d8bf4c0e40bf79d2422d8f530bb484247ff9d876cbb394089a6bf408a5878af009e4871534b2699a8fb6b2df07ba4b0cd5c400119eb771ccd4
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
@@ -0,0 +1,50 @@
1
+ AllCops:
2
+ Include:
3
+ - 'config.ru'
4
+ - 'Rakefile'
5
+ Exclude:
6
+ - 'Gemfile'
7
+ - 'bin/**/*'
8
+ - 'data/**/*'
9
+ - 'db/schema.rb'
10
+ - 'vendor/**/*'
11
+ DisplayCopNames: true
12
+
13
+ Metrics/AbcSize:
14
+ Max: 20
15
+
16
+ Metrics/ClassLength:
17
+ Max: 150
18
+
19
+ Metrics/MethodLength:
20
+ Max: 25
21
+
22
+ Metrics/LineLength:
23
+ Max: 100
24
+
25
+ Metrics/BlockLength:
26
+ Max: 100
27
+
28
+ Style/AndOr:
29
+ EnforcedStyle: conditionals
30
+
31
+ Style/Documentation:
32
+ Enabled: false
33
+
34
+ Style/SymbolArray:
35
+ Enabled: false
36
+
37
+ Style/EmptyLinesAroundClassBody:
38
+ EnforcedStyle: empty_lines
39
+
40
+ Style/MultilineMethodCallIndentation:
41
+ EnforcedStyle: indented
42
+
43
+ Style/PercentLiteralDelimiters:
44
+ PreferredDelimiters:
45
+ '%i': '[]'
46
+ '%w': '[]'
47
+ '%W': '[]'
48
+
49
+ Style/StringLiterals:
50
+ EnforcedStyle: single_quotes
@@ -1,3 +1,14 @@
1
+ ## 1.2.0 (2017-04-14)
2
+
3
+ Features:
4
+
5
+ - Add Invitation
6
+
7
+ Fixes:
8
+
9
+ - Add `document_ids` to Candidate
10
+ - Doc links
11
+
1
12
  ## 1.1.2 (2017-01-05)
2
13
 
3
14
  Fixes:
@@ -8,7 +19,7 @@ Fixes:
8
19
 
9
20
  Features:
10
21
 
11
- - Add support for Candidate.no_middle_name flag (#8)
22
+ - Add support for `Candidate#no_middle_name` flag (#8)
12
23
  - Add Documents to Report (@sico, #12)
13
24
 
14
25
  ## 1.1.0 (2016-03-03)
@@ -1,5 +1,5 @@
1
1
  # Checkr Ruby bindings
2
- # API spec at https://checkr.com/docs/api
2
+ # API spec at https://docs.checkr.com
3
3
  require 'cgi'
4
4
  require 'set'
5
5
  require 'openssl'
@@ -22,7 +22,10 @@ require 'checkr/candidate'
22
22
  require 'checkr/county_criminal_search'
23
23
  require 'checkr/document'
24
24
  require 'checkr/document_list'
25
+ require 'checkr/eviction_search'
25
26
  require 'checkr/geo'
27
+ require 'checkr/global_watchlist_search'
28
+ require 'checkr/invitation'
26
29
  require 'checkr/motor_vehicle_report'
27
30
  require 'checkr/national_criminal_search'
28
31
  require 'checkr/report'
@@ -30,8 +33,6 @@ require 'checkr/report_list'
30
33
  require 'checkr/sex_offender_search'
31
34
  require 'checkr/ssn_trace'
32
35
  require 'checkr/subscription'
33
- require 'checkr/global_watchlist_search'
34
- require 'checkr/eviction_search'
35
36
 
36
37
  # Errors
37
38
  require 'checkr/errors/checkr_error'
@@ -151,14 +152,14 @@ module Checkr
151
152
  raise AuthenticationError.new('No API key provided. ' +
152
153
  'Set your API key using "Checkr.api_key = <API-KEY>". ' +
153
154
  'You can generate API keys from the Checkr web interface. ' +
154
- 'See https://checkr.com/docs#authentication for details, ' +
155
+ 'See https://docs.checkr.com/#authentication for details, ' +
155
156
  'or email hello@checkr.com if you have any questions.')
156
157
  end
157
158
 
158
159
  if api_key =~ /\s/
159
160
  raise AuthenticationError.new('Your API key is invalid, as it contains ' +
160
161
  'whitespace. (HINT: You can double-check your API key from the ' +
161
- 'Checkr web interface. See https://checkr.com/docs#authentication for details, or ' +
162
+ 'Checkr web interface. See https://docs.checkr.com/#authentication for details, or ' +
162
163
  'email hello@checkr.com if you have any questions.)')
163
164
  end
164
165
  end
@@ -250,7 +250,6 @@ module Checkr
250
250
 
251
251
  resp = Checkr.request(method, composed_path, arguments[:params], arguments[:opts])
252
252
 
253
-
254
253
  api_lambda_construct(resp, constructor, self)
255
254
  end
256
255
  end
@@ -21,6 +21,7 @@ module Checkr
21
21
  attribute :geos, APIList.constructor(:Geo)
22
22
  attribute_writer_alias :geo_ids, :geos
23
23
  attribute :documents, :DocumentList, :nested => true, :default => {}
24
+ attribute_writer_alias :document_ids, :documents
24
25
 
25
26
  api_class_method :all, :get, :constructor => APIList.constructor(:Candidate)
26
27
  api_class_method :create, :post
@@ -0,0 +1,28 @@
1
+ module Checkr
2
+ class Invitation < APIResource
3
+
4
+ attribute :uri
5
+ attribute :invitation_url
6
+ attribute :status
7
+ attribute :created_at
8
+ attribute :expires_at
9
+ attribute :completed_at
10
+ attribute :deleted_at
11
+ attribute :package
12
+ attribute :candidate, :Candidate
13
+ attribute_writer_alias :candidate_id, :candidate
14
+
15
+ api_class_method :all, :get,
16
+ constructor: APIList.constructor(:Invitation)
17
+ api_class_method :retrieve, :get, ':path/:id', arguments: [:id]
18
+ api_class_method :create, :post
19
+ api_class_method :cancel, :delete, ':path/:id', arguments: [:id]
20
+
21
+ def self.path
22
+ '/v1/invitations'
23
+ end
24
+
25
+ APIClass.register_subclass(self, 'invitation')
26
+
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Checkr
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
File without changes
@@ -158,10 +158,15 @@ module Checkr
158
158
  end
159
159
 
160
160
  should 'have the documents attribute' do
161
- assert(!@candidate.documents.any?)
161
+ assert(@candidate.documents.any?)
162
162
  assert(@candidate.documents.is_a?(DocumentList))
163
163
  end
164
164
 
165
+ should 'have the document_ids attribute' do
166
+ assert_equal(test_candidate[:document_ids], @candidate.documents.json)
167
+ assert(@candidate.documents.is_a?(APIList))
168
+ end
169
+
165
170
  end
166
171
 
167
172
  should 'be registered' do
@@ -0,0 +1,105 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+ require 'active_support'
3
+ require 'active_support/core_ext/object/to_query'
4
+
5
+ module Checkr
6
+ class InvitationTest < Test::Unit::TestCase
7
+
8
+ setup do
9
+ @inviation_url = "#{Checkr.api_base}/v1/invitations"
10
+ end
11
+
12
+ context 'Invitation class' do
13
+ should 'be listable' do
14
+ params = {
15
+ candidate_id: '2c8447d8c35761ad8f70d9d3',
16
+ package: 'mvr'
17
+ }
18
+ @mock.expects(:get).once.with("#{@inviation_url}?#{params.to_query}", anything, anything)
19
+ .returns(test_response([test_invitation]))
20
+ document = Checkr::Invitation.all(params)
21
+ assert(document.is_a?(APIList))
22
+ assert(document.data[0].id, test_invitation[:id])
23
+ end
24
+
25
+ should 'be retrieveable' do
26
+ id = 'invitation_id'
27
+ @mock.expects(:get).once.with("#{@inviation_url}/#{id}", anything, anything)
28
+ .returns(test_response(test_invitation))
29
+ invitation = Checkr::Invitation.retrieve(id)
30
+ assert(invitation.is_a?(Invitation))
31
+ assert(invitation.candidate.is_a?(Candidate))
32
+ end
33
+
34
+ should 'be createable' do
35
+ @mock.expects(:post).once.with(@inviation_url, anything, test_invitation)
36
+ .returns(test_response(test_invitation))
37
+ invitation = Checkr::Invitation.create(test_invitation)
38
+ assert(invitation.is_a?(Invitation))
39
+ assert_equal(test_invitation[:id], invitation.id)
40
+ end
41
+
42
+ should 'be cancelable' do
43
+ id = '2c8447d8c35761ad8f70d9d3'
44
+ @mock.expects(:delete).once.with("#{@inviation_url}/#{id}", anything, anything)
45
+ .returns(test_response(test_invitation))
46
+ invitation = Checkr::Invitation.cancel(test_invitation[:id])
47
+ assert(invitation.is_a?(Invitation))
48
+ assert_equal(test_invitation[:id], invitation.id)
49
+ end
50
+ end
51
+
52
+ context 'Retrieved Invitation instance' do
53
+ setup do
54
+ @mock.expects(:get).once.returns(test_response(test_invitation))
55
+ @invitation = Checkr::Invitation.retrieve('invitation_id')
56
+ end
57
+
58
+ should 'have the id attribute' do
59
+ assert_equal(test_invitation[:id], @invitation.id)
60
+ end
61
+
62
+ should 'have the status attribute' do
63
+ assert_equal(test_invitation[:status], @invitation.status)
64
+ end
65
+
66
+ should 'have the uri attribute' do
67
+ assert_equal(test_invitation[:uri], @invitation.uri)
68
+ end
69
+
70
+ should 'have the invitation_url attribute' do
71
+ assert_equal(test_invitation[:invitation_url], @invitation.invitation_url)
72
+ end
73
+
74
+ should 'have the completed_at attribute' do
75
+ assert_equal(test_invitation[:completed_at], @invitation.completed_at)
76
+ end
77
+
78
+ should 'have the deleted_at attribute' do
79
+ assert_equal(test_invitation[:deleted_at], @invitation.deleted_at)
80
+ end
81
+
82
+ should 'have the expires_at attribute' do
83
+ assert_equal(test_invitation[:expires_at], @invitation.expires_at)
84
+ end
85
+
86
+ should 'have the package attribute' do
87
+ assert_equal(test_invitation[:package], @invitation.package)
88
+ end
89
+
90
+ should 'have the object attribute' do
91
+ assert_equal(test_invitation[:object], @invitation.object)
92
+ end
93
+
94
+ should 'have the created_at attribute' do
95
+ assert_equal(test_invitation[:created_at], @invitation.created_at)
96
+ end
97
+
98
+ should 'have the candidate_id attribute' do
99
+ assert_equal(test_invitation[:candidate_id], @invitation.candidate.id)
100
+ assert(@invitation.candidate.is_a?(Candidate))
101
+ end
102
+ end
103
+
104
+ end
105
+ end
@@ -60,6 +60,8 @@ module Checkr
60
60
  :copy_requested=>false,
61
61
  :custom_id=>nil,
62
62
  :report_ids=>["532e71cfe88a1d4e8d00000d"],
63
+ :document_ids => ["4722c07dd9a10c3985ae432a"],
64
+ :invitation_ids => ["2c8447d8c35761ad8f70d9d3"],
63
65
  :geo_ids=>["79f943e212cce7de21c054a8", "7299c2c22ebb19abb0688a6c"]}
64
66
  end
65
67
 
@@ -292,6 +294,21 @@ module Checkr
292
294
  :disposition_date=>"2011-06-02"}]}]}
293
295
  end
294
296
 
297
+ def test_invitation
298
+ { id: '2c8447d8c35761ad8f70d9d3',
299
+ status: 'pending',
300
+ uri: '/v1/invitations/2c8447d8c35761ad8f70d9d3',
301
+ invitation_url: 'https://checkr.com/invitations/2c8447d8c35761ad8f70d9d3',
302
+ completed_at: nil,
303
+ deleted_at: nil,
304
+ expires_at: '2015-05-21T17:45:34Z',
305
+ package: 'mvr',
306
+ object: 'invitation',
307
+ created_at: '2015-05-14T17:45:34Z',
308
+ candidate_id: '0130da24eb04f6f13973b490'
309
+ }
310
+ end
311
+
295
312
  def test_motor_vehicle_report
296
313
  {:id=>"539fd88c101897f7cd000007",
297
314
  :object=>"motor_vehicle_report",
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.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -132,6 +132,8 @@ extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
134
  - ".gitignore"
135
+ - ".hound.yml"
136
+ - ".rubocop.yml"
135
137
  - ".travis.yml"
136
138
  - Changelog.md
137
139
  - Gemfile
@@ -156,6 +158,7 @@ files:
156
158
  - lib/checkr/eviction_search.rb
157
159
  - lib/checkr/geo.rb
158
160
  - lib/checkr/global_watchlist_search.rb
161
+ - lib/checkr/invitation.rb
159
162
  - lib/checkr/motor_vehicle_report.rb
160
163
  - lib/checkr/national_criminal_search.rb
161
164
  - lib/checkr/report.rb
@@ -171,6 +174,7 @@ files:
171
174
  - samples/document.md
172
175
  - samples/geo.md
173
176
  - samples/global_watchlist_search.md
177
+ - samples/invitation.md
174
178
  - samples/motor_vehicle_report.md
175
179
  - samples/national_criminal_search.md
176
180
  - samples/report.md
@@ -190,6 +194,7 @@ files:
190
194
  - test/checkr/eviction_search_test.rb
191
195
  - test/checkr/geo_test.rb
192
196
  - test/checkr/global_watchlist_search.rb
197
+ - test/checkr/invitation_test.rb
193
198
  - test/checkr/motor_vehicle_report_test.rb
194
199
  - test/checkr/national_criminal_search_test.rb
195
200
  - test/checkr/report_test.rb
@@ -220,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
225
  version: '0'
221
226
  requirements: []
222
227
  rubyforge_project:
223
- rubygems_version: 2.4.5.1
228
+ rubygems_version: 2.6.11
224
229
  signing_key:
225
230
  specification_version: 4
226
231
  summary: Ruby bindings for Checkr API
@@ -237,6 +242,7 @@ test_files:
237
242
  - test/checkr/eviction_search_test.rb
238
243
  - test/checkr/geo_test.rb
239
244
  - test/checkr/global_watchlist_search.rb
245
+ - test/checkr/invitation_test.rb
240
246
  - test/checkr/motor_vehicle_report_test.rb
241
247
  - test/checkr/national_criminal_search_test.rb
242
248
  - test/checkr/report_test.rb