Skip to content

Commit

Permalink
Merge pull request #49 from CozyCo/add-report-geos
Browse files Browse the repository at this point in the history
Add Geos to Report
  • Loading branch information
nothingisfunny authored Nov 28, 2018
2 parents 9a61c53 + 89084ab commit c71d988
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/checkr/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class Report < APIResource
attribute :documents, APIList.constructor(:Document)
attribute_writer_alias :document_ids, :documents

attribute :geos, APIList.constructor(:Geo), :default => {}
attribute_writer_alias :geo_ids, :geos

attribute :verifications, :VerificationList, :nested => true, :default => {}
attribute_writer_alias :verification_ids, :verifications

Expand Down
5 changes: 5 additions & 0 deletions test/checkr/report_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ class ReportTest < Test::Unit::TestCase
assert(@report.documents.is_a?(APIList))
end

should "have the geos attribute" do
assert_equal(test_report[:geo_ids], @report.geos.json)
assert(@report.geos.is_a?(APIList))
end

should 'have the motor_vehicle_report_id attribute' do
assert_equal(test_report[:motor_vehicle_report_id], @report.motor_vehicle_report.id)
assert(@report.motor_vehicle_report.is_a?(MotorVehicleReport))
Expand Down
3 changes: 2 additions & 1 deletion test/test_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def test_report
["539fdcf335644a0ef4000001", "532e71cfe88a1d4e8d00000i"],
:motor_vehicle_report_id=>"539fd88c101897f7cd000007",
:eviction_search_id=>"539fd88c101897f7cd000008",
:document_ids => ["4722c07dd9a10c3985ae432a"]
:document_ids => ["4722c07dd9a10c3985ae432a"],
:geo_ids => ["e44aa283528e6fde7d542194"]
}
end

Expand Down

0 comments on commit c71d988

Please sign in to comment.