From fa101d459bd70fb1f3257a43980be6b8d506ffe4 Mon Sep 17 00:00:00 2001 From: Aaron Payne Date: Mon, 26 Nov 2018 17:51:39 -0800 Subject: [PATCH 1/2] Add Geos to Report --- lib/checkr/report.rb | 3 +++ test/checkr/report_test.rb | 5 +++++ test/test_data.rb | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/checkr/report.rb b/lib/checkr/report.rb index 3af1696..dd43437 100644 --- a/lib/checkr/report.rb +++ b/lib/checkr/report.rb @@ -41,6 +41,9 @@ class Report < APIResource attribute :documents, APIList.constructor(:Document) attribute_writer_alias :document_ids, :documents + attribute :geos, APIList.constructor(:Geo) + attribute_writer_alias :geo_ids, :geos + attribute :verifications, :VerificationList, :nested => true, :default => {} attribute_writer_alias :verification_ids, :verifications diff --git a/test/checkr/report_test.rb b/test/checkr/report_test.rb index 5abbaf2..a2c2651 100644 --- a/test/checkr/report_test.rb +++ b/test/checkr/report_test.rb @@ -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)) diff --git a/test/test_data.rb b/test/test_data.rb index 06023ed..ee814e0 100644 --- a/test/test_data.rb +++ b/test/test_data.rb @@ -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 From 89084abea4a9bad0f0d379aa7aec645ef43130cc Mon Sep 17 00:00:00 2001 From: Aaron Payne Date: Tue, 27 Nov 2018 14:14:39 -0800 Subject: [PATCH 2/2] Add a default for report geos --- lib/checkr/report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkr/report.rb b/lib/checkr/report.rb index dd43437..f4307f8 100644 --- a/lib/checkr/report.rb +++ b/lib/checkr/report.rb @@ -41,7 +41,7 @@ class Report < APIResource attribute :documents, APIList.constructor(:Document) attribute_writer_alias :document_ids, :documents - attribute :geos, APIList.constructor(:Geo) + attribute :geos, APIList.constructor(:Geo), :default => {} attribute_writer_alias :geo_ids, :geos attribute :verifications, :VerificationList, :nested => true, :default => {}