Skip to content
Snippets Groups Projects
Commit 076a2ebd authored by Alex Reisner's avatar Alex Reisner
Browse files

Include country in address.

parent fa25b785
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ module Geocoder::Result ...@@ -8,7 +8,7 @@ module Geocoder::Result
end end
def address(format = :full) def address(format = :full)
(1..3).to_a.map{ |i| @data["line#{i}"] }.reject{ |i| i.nil? or i == "" }.join(", ") (1..4).to_a.map{ |i| @data["line#{i}"] }.reject{ |i| i.nil? or i == "" }.join(", ")
end end
def self.response_attributes def self.response_attributes
......
...@@ -58,7 +58,7 @@ class GeocoderTest < Test::Unit::TestCase ...@@ -58,7 +58,7 @@ class GeocoderTest < Test::Unit::TestCase
Geocoder::Configuration.lookup = :yahoo Geocoder::Configuration.lookup = :yahoo
Geocoder.send :set_lookup, :yahoo Geocoder.send :set_lookup, :yahoo
results = Geocoder.search("Madison Square Garden, New York, NY") results = Geocoder.search("Madison Square Garden, New York, NY")
assert_equal "Madison Square Garden, New York, NY 10001", assert_equal "Madison Square Garden, New York, NY 10001, United States",
results.first.address results.first.address
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment