checkr-official 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.md +12 -4
- data/VERSION +1 -1
- data/lib/checkr/api_class.rb +11 -6
- data/lib/checkr/document.rb +3 -0
- data/samples/candidate.md +195 -0
- data/samples/country_criminal_search.md +60 -0
- data/samples/document.md +109 -0
- data/samples/geo.md +150 -0
- data/samples/motor_vehicle_report.md +136 -0
- data/samples/national_criminal_search.md +56 -0
- data/samples/report.md +158 -0
- data/samples/sex_offender_search.md +58 -0
- data/samples/ssn_trace.md +136 -0
- data/samples/subscription.md +143 -0
- data/samples/terrorist_watchlist_search.md +118 -0
- data/test/checkr/document_list_test.rb +36 -0
- data/test/checkr/document_test.rb +9 -4
- data/test/checkr/report_test.rb +5 -0
- data/test/test_data.rb +1 -0
- metadata +14 -1
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
|
3
|
+
module Checkr
|
4
|
+
class DocumentListTest < Test::Unit::TestCase
|
5
|
+
setup do
|
6
|
+
@candidate = Candidate.construct(test_candidate)
|
7
|
+
@document_url = "#{Checkr.api_base}#{@candidate.path}/documents"
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'DocumentList class' do
|
11
|
+
should 'be createable' do
|
12
|
+
new_doc = {
|
13
|
+
:type => "driver_license",
|
14
|
+
:file => "fake_file"
|
15
|
+
}
|
16
|
+
@mock.expects(:post).once.with(@document_url, anything, new_doc).returns(test_response(test_document))
|
17
|
+
document = @candidate.documents.create(new_doc)
|
18
|
+
assert(document.is_a?(Document))
|
19
|
+
assert_equal(test_document[:id], document.id)
|
20
|
+
end
|
21
|
+
|
22
|
+
should 'be listable' do
|
23
|
+
@mock.expects(:get).once.with(@document_url, anything, anything).returns(test_response(test_document_list))
|
24
|
+
|
25
|
+
documents = @candidate.documents.all
|
26
|
+
|
27
|
+
assert(documents.is_a?(DocumentList))
|
28
|
+
documents.each do |document|
|
29
|
+
assert(document.is_a?(Document))
|
30
|
+
end
|
31
|
+
assert(documents.length > 0)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -11,18 +11,23 @@ module Checkr
|
|
11
11
|
should 'be createable' do
|
12
12
|
new_doc = {
|
13
13
|
:type => "driver_license",
|
14
|
-
:file => "fake_file"
|
14
|
+
:file => "fake_file",
|
15
|
+
:candidate_id => @candidate.id
|
15
16
|
}
|
16
17
|
@mock.expects(:post).once.with(@document_url, anything, new_doc).returns(test_response(test_document))
|
17
|
-
document =
|
18
|
+
document = Checkr::Document.create(new_doc)
|
18
19
|
assert(document.is_a?(Document))
|
19
20
|
assert_equal(test_document[:id], document.id)
|
20
21
|
end
|
21
22
|
|
22
23
|
should 'be listable' do
|
23
|
-
@mock.expects(:get).once.with
|
24
|
+
@mock.expects(:get).once.with do |url, params, opts|
|
25
|
+
url.start_with?(@document_url)
|
26
|
+
end.returns(test_response(test_document_list))
|
24
27
|
|
25
|
-
documents =
|
28
|
+
documents = Checkr::Document.all({
|
29
|
+
:candidate_id => @candidate.id
|
30
|
+
})
|
26
31
|
|
27
32
|
assert(documents.is_a?(DocumentList))
|
28
33
|
documents.each do |document|
|
data/test/checkr/report_test.rb
CHANGED
@@ -103,6 +103,11 @@ module Checkr
|
|
103
103
|
assert(@report.national_criminal_search.is_a?(NationalCriminalSearch))
|
104
104
|
end
|
105
105
|
|
106
|
+
should 'have the terrorist_watchlist_search_id attribute' do
|
107
|
+
assert_equal(test_report[:terrorist_watchlist_search_id], @report.terrorist_watchlist_search.id)
|
108
|
+
assert(@report.terrorist_watchlist_search.is_a?(TerroristWatchlistSearch))
|
109
|
+
end
|
110
|
+
|
106
111
|
should 'have the county_criminal_search_ids attribute' do
|
107
112
|
assert_equal(test_report[:county_criminal_search_ids], @report.county_criminal_searches.json)
|
108
113
|
assert(@report.county_criminal_searches.is_a?(APIList))
|
data/test/test_data.rb
CHANGED
@@ -84,6 +84,7 @@ module Checkr
|
|
84
84
|
:ssn_trace_id=>"539fd88c101897f7cd000001",
|
85
85
|
:sex_offender_search_id=>"539fd88c101897f7cd000008",
|
86
86
|
:national_criminal_search_id=>"539fd88c101897f7cd000006",
|
87
|
+
:terrorist_watchlist_search_id=>"53f11ec23934620002010000",
|
87
88
|
:county_criminal_search_ids=>
|
88
89
|
["539fdcf335644a0ef4000001", "532e71cfe88a1d4e8d00000i"],
|
89
90
|
:motor_vehicle_report_id=>"539fd88c101897f7cd000007"}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkr-official
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Calhoun
|
@@ -161,6 +161,17 @@ files:
|
|
161
161
|
- lib/checkr/util.rb
|
162
162
|
- lib/checkr/version.rb
|
163
163
|
- mclovin.jpg
|
164
|
+
- samples/candidate.md
|
165
|
+
- samples/country_criminal_search.md
|
166
|
+
- samples/document.md
|
167
|
+
- samples/geo.md
|
168
|
+
- samples/motor_vehicle_report.md
|
169
|
+
- samples/national_criminal_search.md
|
170
|
+
- samples/report.md
|
171
|
+
- samples/sex_offender_search.md
|
172
|
+
- samples/ssn_trace.md
|
173
|
+
- samples/subscription.md
|
174
|
+
- samples/terrorist_watchlist_search.md
|
164
175
|
- tasks/api_test.rb
|
165
176
|
- test/checkr/api_class_test.rb
|
166
177
|
- test/checkr/api_list_test.rb
|
@@ -169,6 +180,7 @@ files:
|
|
169
180
|
- test/checkr/authentication_test.rb
|
170
181
|
- test/checkr/candidate_test.rb
|
171
182
|
- test/checkr/county_criminal_search_test.rb
|
183
|
+
- test/checkr/document_list_test.rb
|
172
184
|
- test/checkr/document_test.rb
|
173
185
|
- test/checkr/geo_test.rb
|
174
186
|
- test/checkr/motor_vehicle_report_test.rb
|
@@ -214,6 +226,7 @@ test_files:
|
|
214
226
|
- test/checkr/authentication_test.rb
|
215
227
|
- test/checkr/candidate_test.rb
|
216
228
|
- test/checkr/county_criminal_search_test.rb
|
229
|
+
- test/checkr/document_list_test.rb
|
217
230
|
- test/checkr/document_test.rb
|
218
231
|
- test/checkr/geo_test.rb
|
219
232
|
- test/checkr/motor_vehicle_report_test.rb
|