Skip to content
Snippets Groups Projects
Commit c1d80657 authored by Aaron Parecki's avatar Aaron Parecki
Browse files

add `source_country` parameter for esri geocoder

parent a4e6f662
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ module Geocoder::Lookup
end
params[:token] = token
params[:forStorage] = configuration[:for_storage] if configuration[:for_storage]
params[:sourceCountry] = configuration[:source_country] if configuration[:source_country]
params.merge(super)
end
......
......@@ -16,6 +16,14 @@ class EsriTest < GeocoderTestCase
res
end
def test_query_for_geocode_with_source_country
Geocoder.configure(esri: {source_country: 'USA'})
query = Geocoder::Query.new("Bluffton, SC")
lookup = Geocoder::Lookup.get(:esri)
url = lookup.query_url(query)
assert_match /sourceCountry=USA/, url
end
def test_query_for_geocode_with_token_and_for_storage
token = Geocoder::EsriToken.new('xxxxx', Time.now + 1.day)
Geocoder.configure(esri: {token: token, for_storage: true})
......
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