diff --git a/lib/geocoder/results/geocodio.rb b/lib/geocoder/results/geocodio.rb index dbe5605f8b247778eab6813408d874698f569b53..f15ed0fbdf8fc2d726774fa3aa9963eb65e9b55a 100644 --- a/lib/geocoder/results/geocodio.rb +++ b/lib/geocoder/results/geocodio.rb @@ -40,7 +40,7 @@ module Geocoder::Result end def country_code - address_components['country'] || "US" + address_components['country'] end def city diff --git a/test/fixtures/geocodio_1101_pennsylvania_ave b/test/fixtures/geocodio_1101_pennsylvania_ave index c907deeeb1298bd2f9171e19502e776b33d85dcd..4b6a0627a1d1a5376831c9cb233cf8697efc8c55 100644 --- a/test/fixtures/geocodio_1101_pennsylvania_ave +++ b/test/fixtures/geocodio_1101_pennsylvania_ave @@ -1 +1 @@ -{"input":{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","formatted_street":"Pennsylvania Ave NW","city":"Washington","state":"DC"},"formatted_address":"1101 Pennsylvania Ave NW, Washington, DC"},"results":[{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","formatted_street":"Pennsylvania Ave NW","city":"Washington","county":"District of Columbia","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington, DC 20004","location":{"lat":38.895019,"lng":-77.028095},"accuracy":1,"accuracy_type":"range_interpolation"},{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","formatted_street":"Pennsylvania Ave NW","city":"Washington","county":"District of Columbia","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington, DC 20004","location":{"lat":38.895016122449,"lng":-77.028084377551},"accuracy":0.8,"accuracy_type":"range_interpolation"}]} \ No newline at end of file +{"input":{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","formatted_street":"Pennsylvania Ave NW","city":"Washington","state":"DC","zip":"20001","country":"US"},"formatted_address":"1101 Pennsylvania Ave NW, Washington, DC 20001"},"results":[{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","formatted_street":"Pennsylvania Ave NW","city":"Washington","county":"District of Columbia","state":"DC","zip":"20004","country":"US"},"formatted_address":"1101 Pennsylvania Ave NW, Washington, DC 20004","location":{"lat":38.895156,"lng":-77.027405},"accuracy":1,"accuracy_type":"rooftop","source":"DC Geographic Information Systems Program (DC GIS)"}]} diff --git a/test/unit/lookups/geocodio_test.rb b/test/unit/lookups/geocodio_test.rb index 250ce410f220d662f74ce75f6bc3107937b3430e..20db0f9ffd64994170dc9563dda13c50320146df 100644 --- a/test/unit/lookups/geocodio_test.rb +++ b/test/unit/lookups/geocodio_test.rb @@ -21,7 +21,7 @@ class GeocodioTest < GeocoderTestCase assert_equal "US", result.country_code assert_equal "United States", result.country assert_equal "1101 Pennsylvania Ave NW, Washington, DC 20004", result.formatted_address - assert_equal({ "lat" => 38.895019, "lng" => -77.028095 }, result.location) + assert_equal({ "lat" => 38.895156, "lng" => -77.027405 }, result.location) end def test_reverse_canada_result