Skip to content
Snippets Groups Projects
Unverified Commit a40d28b5 authored by Tamas Erdos's avatar Tamas Erdos
Browse files

fixing test

parent 709f4211
No related branches found
No related tags found
No related merge requests found
# encoding: utf-8
require 'test_helper'
require 'geocoder/esri_token'
class EsriTest < GeocoderTestCase
......@@ -16,16 +17,17 @@ class EsriTest < GeocoderTestCase
end
def test_query_for_geocode_with_token_for_storage
token = 'xxxxx'
Geocoder.configure(token: token, for_storage: true)
token = Geocoder::EsriToken.new('xxxxx', Time.now + 1.day)
Geocoder.configure(esri: {token: token, for_storage: true})
query = Geocoder::Query.new("Bluffton, SC")
lookup = Geocoder::Lookup.get(:esri)
res = lookup.query_url(query)
assert_equal "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?f=pjson&outFields=%2A&text=Bluffton%2C+SC&forStorage=true&token=xxxxx",
assert_equal "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?f=pjson&forStorage=true&outFields=%2A&text=Bluffton%2C+SC&token=xxxxx",
res
end
def test_query_for_reverse_geocode
Geocoder.configure(esri: {token: nil, for_storage: nil})
query = Geocoder::Query.new([45.423733, -75.676333])
lookup = Geocoder::Lookup.get(:esri)
res = lookup.query_url(query)
......
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