Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/geocoder/results/mapbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def coordinates
end

def place_name
data['text']
data['place_name']
end

def street
Expand Down Expand Up @@ -78,4 +78,3 @@ def context
end
end
end

10 changes: 5 additions & 5 deletions test/unit/lookups/mapbox_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_url_contains_params
def test_result_components
result = Geocoder.search("Madison Square Garden, New York, NY").first
assert_equal [40.750755, -73.993710125], result.coordinates
assert_equal "Madison Square Garden", result.place_name
assert_equal "Madison Square Garden, 4 Penn Plz, New York, New York 10119, United States", result.place_name
assert_equal "4 Penn Plz", result.street
assert_equal "New York", result.city
assert_equal "New York", result.state
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_mapbox_result_without_context
def test_neighborhood_result
result = Geocoder.search("Logan Square, Chicago, IL").first
assert_equal [41.92597, -87.70235], result.coordinates
assert_equal "Logan Square", result.place_name
assert_equal "Logan Square, Chicago, Illinois, United States", result.place_name
assert_equal nil, result.street
assert_equal "Chicago", result.city
assert_equal "Illinois", result.state
Expand All @@ -81,7 +81,7 @@ def test_neighborhood_result
def test_postcode_result
result = Geocoder.search("Chicago, IL 60647").first
assert_equal [41.924799, -87.700436], result.coordinates
assert_equal "60647", result.place_name
assert_equal "Chicago, Illinois 60647, United States", result.place_name
assert_equal nil, result.street
assert_equal "Chicago", result.city
assert_equal "Illinois", result.state
Expand All @@ -96,7 +96,7 @@ def test_postcode_result
def test_place_result
result = Geocoder.search("Chicago, IL").first
assert_equal [41.881954, -87.63236], result.coordinates
assert_equal "Chicago", result.place_name
assert_equal "Chicago, Illinois, United States", result.place_name
assert_equal nil, result.street
assert_equal "Chicago", result.city
assert_equal "Illinois", result.state
Expand All @@ -111,7 +111,7 @@ def test_place_result
def test_region_result
result = Geocoder.search("Illinois").first
assert_equal [40.1492928594374, -89.2749461071049], result.coordinates
assert_equal "Illinois", result.place_name
assert_equal "Illinois, United States", result.place_name
assert_equal nil, result.street
assert_equal nil, result.city
assert_equal "Illinois", result.state
Expand Down