diff --git a/lib/geocoder/results/geocodio.rb b/lib/geocoder/results/geocodio.rb index e80c750f58c7d148a0a9a35d23f4e29ba5d5aa72..cd5b32be450b269e1bbeb1279fe2e9238054af36 100644 --- a/lib/geocoder/results/geocodio.rb +++ b/lib/geocoder/results/geocodio.rb @@ -45,7 +45,7 @@ module Geocoder::Result end def coordinates - ['lat', 'lng'].map{ |i| location[i] } if location + ['lat', 'lng'].map{ |i| location[i].to_f } if location end def accuracy diff --git a/test/fixtures/geocodio_1101_pennsylvania_ave b/test/fixtures/geocodio_1101_pennsylvania_ave index c89bf170083818f5e30b7f07eb9bccbf8d6e7ff4..f77e804548cf02f47841cb0821bdb3470fd426ee 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","city":"Washington","state":"DC"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC"},"results":[{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","city":"Washington","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC, 20004","location":{"lat":38.895019,"lng":-77.028095},"accuracy":1},{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","city":"Washington","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC, 20004","location":{"lat":38.895016122449,"lng":-77.028084377551},"accuracy":0.8}]} \ No newline at end of file +{"input":{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","city":"Washington","state":"DC"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC"},"results":[{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","city":"Washington","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC, 20004","location":{"lat":"38.895019","lng":"-77.028095"},"accuracy":1},{"address_components":{"number":"1101","street":"Pennsylvania","suffix":"Ave","postdirectional":"NW","city":"Washington","state":"DC","zip":"20004"},"formatted_address":"1101 Pennsylvania Ave NW, Washington DC, 20004","location":{"lat":"38.895016122449","lng":"-77.028084377551"},"accuracy":0.8}]} \ No newline at end of file diff --git a/test/unit/lookups/geocodio_test.rb b/test/unit/lookups/geocodio_test.rb index c1ac2c746206c98e22571912a750d8a62fb51c6d..b773a92115734e57333e4c7263010230429ba1d1 100644 --- a/test/unit/lookups/geocodio_test.rb +++ b/test/unit/lookups/geocodio_test.rb @@ -19,7 +19,7 @@ class GeocodioTest < GeocoderTestCase assert_equal "NW", result.postdirectional assert_equal "Washington", result.city 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.895019", "lng" => "-77.028095" }, result.location) end def test_no_results