checkr-official 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 2ccafdc7b87f315c5f14d9c79f8d12cbc701e810
4
- data.tar.gz: e7c5657e8b647000b5affea8d230f9d1108ead92
3
+ metadata.gz: 0fd54e3b5798dd838beb31c43bc7b3a4da619cf2
4
+ data.tar.gz: bf941cf26a026ee573504678a247571a61001644
5
5
  SHA512:
6
- metadata.gz: b8e4424123de74f5be964464c0d2bbed9e01036ae1ab35327da5e42a371910c25057f78564e566ab1d86e7e593b723d18fb710c45e88b7ad7aca2748d9ae8577
7
- data.tar.gz: 848abe2c0c6f2989bd9e6b0ecdc62a94630c9bc772e203159ac2696497e77eaac5927cf56c970efd2ba71d7e7b546c5427617fa6f53319bd58792a111b86924a
6
+ metadata.gz: 19fe187497cd058cdf766ed3f2ad6aefd9f8a3e2908946b36003648690925e430a939e8ad1f4308ad2c57bb7c91be78fad8fb8a2e525d5a80356bc8d646dcecc
7
+ data.tar.gz: 80ed601d77f401b45b0bb179874e2f1e8d9b235952639df7964bc0c237879e93b11c2b0cd135b2fb08b6a48adbb78b9c0069556dade90ca3fe0346a13aaa5e82
@@ -1,3 +1,7 @@
1
+ === 1.0.2 2015-03-24
2
+ * 1 minor enchancement:
3
+ * Fixed a bug with Util.constantize
4
+
1
5
  === 1.0.1 2015-03-24
2
6
  * 1 minor enchancement:
3
7
  * Updated documents class to feel like other classes.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -31,6 +31,7 @@ require 'checkr/sex_offender_search'
31
31
  require 'checkr/ssn_trace'
32
32
  require 'checkr/subscription'
33
33
  require 'checkr/terrorist_watchlist_search'
34
+ require 'checkr/eviction_search'
34
35
 
35
36
  # Errors
36
37
  require 'checkr/errors/checkr_error'
@@ -94,12 +95,7 @@ module Checkr
94
95
  raise APIError.generic(response.code, response.body)
95
96
  end
96
97
 
97
- # TODO(jonclahoun): Remove this when Checkr's API returns the correct status code.
98
98
  json = Util.symbolize_keys(json)
99
- if json.has_key?(:error)
100
- raise CheckrError.new(json[:error][:message], response.code, response.body, json)
101
- end
102
-
103
99
  json
104
100
  end
105
101
 
@@ -369,7 +369,7 @@ module Checkr
369
369
  end
370
370
 
371
371
  unless missing.empty?
372
- raise InvalidRequestError.new("Could not determine the full URL to request. Missing the following values: #{missing.to_a.join(', ')}.")
372
+ raise InvalidRequestError.new("Could not determine the full URL to request. Missing the following values: #{missing.to_a.join(', ')}.", "url")
373
373
  end
374
374
  end
375
375
  ret
@@ -0,0 +1,17 @@
1
+ module Checkr
2
+ class EvictionSearch < 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/evictions"
13
+ end
14
+
15
+ APIClass.register_subclass(self, "eviction_search")
16
+ end
17
+ end
@@ -13,6 +13,9 @@ module Checkr
13
13
  attribute :ssn_trace, :SSNTrace
14
14
  attribute_writer_alias :ssn_trace_id, :ssn_trace
15
15
 
16
+ attribute :eviction_search, :EvictionSearch
17
+ attribute_writer_alias :eviction_search_id, :eviction_search
18
+
16
19
  attribute :sex_offender_search, :SexOffenderSearch
17
20
  attribute_writer_alias :sex_offender_search_id, :sex_offender_search
18
21
 
@@ -74,17 +74,11 @@ module Checkr
74
74
  end
75
75
 
76
76
  def self.constantize(str, prefix=false)
77
- str = str.to_s
78
- begin
79
- str.split('::').reduce(Module, :const_get)
80
- rescue NameError => e
81
- if prefix
82
- raise e
83
- else
84
- p = "#{self.name}".split("::").first
85
- constantize("#{p}::#{str}", true)
86
- end
77
+ p = "#{self.name}".split("::").first
78
+ if "#{str}".split("::").first != p
79
+ str = "#{p}::#{str}"
87
80
  end
81
+ str.split('::').reduce(Module, :const_get)
88
82
  end
89
83
 
90
84
  end
@@ -43,7 +43,6 @@
43
43
  "fine_amount": null,
44
44
  "acd_code": null,
45
45
  "state_code": null,
46
- "additional_info": null,
47
46
  "injury_accident": false,
48
47
  "fatality_accident": false,
49
48
  "fatality_count": 0,
@@ -70,8 +69,7 @@
70
69
  "court_name": null,
71
70
  "acd_code": null,
72
71
  "state_code": null,
73
- "docket": null,
74
- "additional_info": null
72
+ "docket": null
75
73
  }
76
74
  ],
77
75
  "id": "539fd88c101897f7cd000007",
@@ -18,7 +18,6 @@
18
18
  "court_of_record": null,
19
19
  "dob": "1970-01-22",
20
20
  "full_name": "John Alfred Smith",
21
- "additional_info": null,
22
21
  "charges": [
23
22
  {
24
23
  "charge": "RICO murder",
@@ -30,15 +29,13 @@
30
29
  "plaintiff": null,
31
30
  "sentence": "Active Punishment Minimum: 10Y",
32
31
  "disposition": "Guilty",
33
- "notes": null,
34
32
  "probation_status": null,
35
33
  "offense_date": "2011-04-22",
36
34
  "deposition_date": "2014-05-27",
37
35
  "arrest_date": null,
38
36
  "charge_date": null,
39
37
  "sentence_date": null,
40
- "disposition_date": "2011-06-02",
41
- "additional_info": null
38
+ "disposition_date": "2011-06-02"
42
39
  }
43
40
  ]
44
41
  }
@@ -85,7 +82,6 @@ tws = Checkr::TerroristWatchlistSearch.retrieve("539fd88c101897f7cd000008")
85
82
  "court_of_record": null,
86
83
  "dob": "1970-01-22",
87
84
  "full_name": "John Alfred Smith",
88
- "additional_info": null,
89
85
  "charges": [
90
86
  {
91
87
  "charge": "RICO murder",
@@ -97,15 +93,13 @@ tws = Checkr::TerroristWatchlistSearch.retrieve("539fd88c101897f7cd000008")
97
93
  "plaintiff": null,
98
94
  "sentence": "Active Punishment Minimum: 10Y",
99
95
  "disposition": "Guilty",
100
- "notes": null,
101
96
  "probation_status": null,
102
97
  "offense_date": "2011-04-22",
103
98
  "deposition_date": "2014-05-27",
104
99
  "arrest_date": null,
105
100
  "charge_date": null,
106
101
  "sentence_date": null,
107
- "disposition_date": "2011-06-02",
108
- "additional_info": null
102
+ "disposition_date": "2011-06-02"
109
103
  }
110
104
  ]
111
105
  }
@@ -0,0 +1,74 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ module Checkr
4
+ class EvictionSearchTest < Test::Unit::TestCase
5
+ setup do
6
+ @eviction_search_url = "#{Checkr.api_base}/v1/evictions"
7
+ end
8
+
9
+ context 'EvictionSearch class' do
10
+ should 'be retrieveable' do
11
+ id = "eviction_search_id"
12
+ @mock.expects(:get).once.with("#{@eviction_search_url}/#{id}", anything, anything).returns(test_response(test_eviction_search))
13
+ eviction_search = EvictionSearch.retrieve(id)
14
+ assert(eviction_search.is_a?(EvictionSearch))
15
+ end
16
+ end
17
+
18
+ context 'EvictionSearch instance' do
19
+ should 'be refreshable' do
20
+ @mock.expects(:get).once.with("#{@eviction_search_url}/#{test_eviction_search[:id]}", anything, anything).returns(test_response(test_eviction_search))
21
+ eviction_search = EvictionSearch.new(test_eviction_search[:id])
22
+ eviction_search.refresh
23
+ assert_equal(test_eviction_search[:status], eviction_search.status)
24
+ end
25
+ end
26
+
27
+
28
+ context 'Retrieved EvictionSearch instance' do
29
+ setup do
30
+ @mock.expects(:get).once.returns(test_response(test_eviction_search))
31
+ @eviction_search = EvictionSearch.retrieve('eviction_search_id')
32
+ end
33
+
34
+ should 'have the id attribute' do
35
+ assert_equal(test_eviction_search[:id], @eviction_search.id)
36
+ end
37
+
38
+ should 'have the object attribute' do
39
+ assert_equal(test_eviction_search[:object], @eviction_search.object)
40
+ end
41
+
42
+ should 'have the uri attribute' do
43
+ assert_equal(test_eviction_search[:uri], @eviction_search.uri)
44
+ end
45
+
46
+ should 'have the status attribute' do
47
+ assert_equal(test_eviction_search[:status], @eviction_search.status)
48
+ end
49
+
50
+ should 'have the created_at attribute' do
51
+ assert_equal(test_eviction_search[:created_at], @eviction_search.created_at)
52
+ end
53
+
54
+ should 'have the completed_at attribute' do
55
+ assert_equal(test_eviction_search[:completed_at], @eviction_search.completed_at)
56
+ end
57
+
58
+ should 'have the turnaround_time attribute' do
59
+ assert_equal(test_eviction_search[:turnaround_time], @eviction_search.turnaround_time)
60
+ end
61
+
62
+ should 'have the records attribute' do
63
+ assert_equal(test_eviction_search[:records], @eviction_search.records)
64
+ end
65
+
66
+ end
67
+
68
+ should 'be registered' do
69
+ assert(APIClass.subclasses.include?(EvictionSearch))
70
+ assert_equal(EvictionSearch, APIClass.subclass_fetch("eviction_search"))
71
+ end
72
+
73
+ end
74
+ end
@@ -118,6 +118,11 @@ module Checkr
118
118
  assert(@report.motor_vehicle_report.is_a?(MotorVehicleReport))
119
119
  end
120
120
 
121
+ should 'have the eviction_search_id attribute' do
122
+ assert_equal(test_report[:eviction_search_id], @report.eviction_search.id)
123
+ assert(@report.eviction_search.is_a?(EvictionSearch))
124
+ end
125
+
121
126
  end
122
127
 
123
128
  should 'be registered' do
@@ -87,7 +87,8 @@ module Checkr
87
87
  :terrorist_watchlist_search_id=>"53f11ec23934620002010000",
88
88
  :county_criminal_search_ids=>
89
89
  ["539fdcf335644a0ef4000001", "532e71cfe88a1d4e8d00000i"],
90
- :motor_vehicle_report_id=>"539fd88c101897f7cd000007"}
90
+ :motor_vehicle_report_id=>"539fd88c101897f7cd000007",
91
+ :eviction_search_id=>"539fd88c101897f7cd000008"}
91
92
  end
92
93
 
93
94
  def test_report_list
@@ -174,7 +175,6 @@ module Checkr
174
175
  :registration_start=>"2011-02-12",
175
176
  :registration_end=>"life registration",
176
177
  :photo=>"http://goo.gl/wk4X6f",
177
- :additional_info=>nil,
178
178
  :charges=>
179
179
  [{:charge=>"Sexual Assault Statute: 948.02(2)",
180
180
  :victim=>"Child",
@@ -199,7 +199,6 @@ module Checkr
199
199
  :court_of_record=>nil,
200
200
  :dob=>"1970-01-22",
201
201
  :full_name=>"John Alfred Smith",
202
- :additional_info=>nil,
203
202
  :charges=>
204
203
  [{:charge=>"RICO murder",
205
204
  :charge_type=>nil,
@@ -210,15 +209,13 @@ module Checkr
210
209
  :plaintiff=>nil,
211
210
  :sentence=>"Active Punishment Minimum: 10Y",
212
211
  :disposition=>"Guilty",
213
- :notes=>nil,
214
212
  :probation_status=>nil,
215
213
  :offense_date=>"2011-04-22",
216
214
  :deposition_date=>"2014-05-27",
217
215
  :arrest_date=>nil,
218
216
  :charge_date=>nil,
219
217
  :sentence_date=>nil,
220
- :disposition_date=>"2011-06-02",
221
- :additional_info=>nil}]}]}
218
+ :disposition_date=>"2011-06-02"}]}]}
222
219
  end
223
220
 
224
221
  def test_national_criminal_search
@@ -237,7 +234,6 @@ module Checkr
237
234
  :court_of_record=>nil,
238
235
  :dob=>"1970-01-22",
239
236
  :full_name=>"John Alfred Smith",
240
- :additional_info=>nil,
241
237
  :charges=>
242
238
  [{:charge=>"Sell Cocaine",
243
239
  :charge_type=>nil,
@@ -248,15 +244,13 @@ module Checkr
248
244
  :plaintiff=>nil,
249
245
  :sentence=>"Active Punishment Minimum: 10M",
250
246
  :disposition=>"Guilty",
251
- :notes=>"CREDIT FOR TIME SERVED: 41D DA",
252
247
  :probation_status=>nil,
253
248
  :offense_date=>"2011-04-22",
254
249
  :deposition_date=>"2014-05-27",
255
250
  :arrest_date=>nil,
256
251
  :charge_date=>nil,
257
252
  :sentence_date=>nil,
258
- :disposition_date=>"2011-06-02",
259
- :additional_info=>nil}]}]}
253
+ :disposition_date=>"2011-06-02"}]}]}
260
254
  end
261
255
 
262
256
  def test_county_criminal_search
@@ -277,7 +271,6 @@ module Checkr
277
271
  :court_of_record=>nil,
278
272
  :dob=>"1970-01-22",
279
273
  :full_name=>"John Alfred Smith",
280
- :additional_info=>nil,
281
274
  :charges=>
282
275
  [{:charge=>"Sell Cocaine",
283
276
  :charge_type=>nil,
@@ -288,15 +281,13 @@ module Checkr
288
281
  :plaintiff=>nil,
289
282
  :sentence=>"Active Punishment Minimum: 10M",
290
283
  :disposition=>"Guilty",
291
- :notes=>"CREDIT FOR TIME SERVED: 41D DA",
292
284
  :probation_status=>nil,
293
285
  :offense_date=>"2011-04-22",
294
286
  :deposition_date=>"2014-05-27",
295
287
  :arrest_date=>"2011-04-22",
296
288
  :charge_date=>nil,
297
289
  :sentence_date=>"2011-06-02",
298
- :disposition_date=>"2011-06-02",
299
- :additional_info=>nil}]}]}
290
+ :disposition_date=>"2011-06-02"}]}]}
300
291
  end
301
292
 
302
293
  def test_motor_vehicle_report
@@ -338,7 +329,6 @@ module Checkr
338
329
  :fine_amount=>nil,
339
330
  :acd_code=>nil,
340
331
  :state_code=>nil,
341
- :additional_info=>nil,
342
332
  :injury_accident=>false,
343
333
  :fatality_accident=>false,
344
334
  :fatality_count=>0,
@@ -362,8 +352,34 @@ module Checkr
362
352
  :court_name=>nil,
363
353
  :acd_code=>nil,
364
354
  :state_code=>nil,
365
- :docket=>nil,
366
- :additional_info=>nil}]}
355
+ :docket=>nil}]}
356
+ end
357
+
358
+ def test_eviction_search
359
+ { :id => "539fd88c101897f7cd000008",
360
+ :object => "eviction",
361
+ :uri => "/v1/evictions/539fd88c101897f7cd000008",
362
+ :status => "consider",
363
+ :created_at => "2014-01-18T12:34:00Z",
364
+ :completed_at => "2014-01-18T12:35:30Z",
365
+ :turnaround_time => 90,
366
+ :records =>
367
+ [{
368
+ :case_number => "24323-DA",
369
+ :file_date => "2013-10-08",
370
+ :court_jurisdiction => "San Francisco",
371
+ :full_name => "John Alfred Smith",
372
+ :judgement_amount => 1500,
373
+ :plaintiff => "Roger Peterson",
374
+ :offense => "Non payment",
375
+ :address => {
376
+ :street => "123 S Folsom St",
377
+ :unit => nil,
378
+ :city => "San Francisco",
379
+ :state => "CA",
380
+ :zipcode => "94110"
381
+ }
382
+ }]}
367
383
  end
368
384
 
369
385
  def test_document
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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -149,6 +149,7 @@ files:
149
149
  - lib/checkr/errors/authentication_error.rb
150
150
  - lib/checkr/errors/checkr_error.rb
151
151
  - lib/checkr/errors/invalid_request_error.rb
152
+ - lib/checkr/eviction_search.rb
152
153
  - lib/checkr/geo.rb
153
154
  - lib/checkr/motor_vehicle_report.rb
154
155
  - lib/checkr/national_criminal_search.rb
@@ -182,6 +183,7 @@ files:
182
183
  - test/checkr/county_criminal_search_test.rb
183
184
  - test/checkr/document_list_test.rb
184
185
  - test/checkr/document_test.rb
186
+ - test/checkr/eviction_search_test.rb
185
187
  - test/checkr/geo_test.rb
186
188
  - test/checkr/motor_vehicle_report_test.rb
187
189
  - test/checkr/national_criminal_search_test.rb
@@ -214,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
216
  version: '0'
215
217
  requirements: []
216
218
  rubyforge_project:
217
- rubygems_version: 2.4.5
219
+ rubygems_version: 2.2.2
218
220
  signing_key:
219
221
  specification_version: 4
220
222
  summary: Ruby bindings for Checkr API
@@ -228,6 +230,7 @@ test_files:
228
230
  - test/checkr/county_criminal_search_test.rb
229
231
  - test/checkr/document_list_test.rb
230
232
  - test/checkr/document_test.rb
233
+ - test/checkr/eviction_search_test.rb
231
234
  - test/checkr/geo_test.rb
232
235
  - test/checkr/motor_vehicle_report_test.rb
233
236
  - test/checkr/national_criminal_search_test.rb