Skip to content

Instantly share code, notes, and snippets.

@linko
Created May 12, 2014 22:13
Show Gist options
  • Save linko/45a4c20c7dad91c77692 to your computer and use it in GitHub Desktop.
Save linko/45a4c20c7dad91c77692 to your computer and use it in GitHub Desktop.
Geocoder.configure(:lookup => :test)
Geocoder::Lookup::Test.set_default_stub(
[
{
'latitude' => 40.7143528,
'longitude' => -74.0059731,
'address' => 'New York, NY, USA',
'state' => 'New York',
'state_code' => 'NY',
'country' => 'United States',
'country_code' => 'US'
}
]
)
Geocoder::Lookup::Test.add_stub(
"New York, NY", [
{
'latitude' => 40.7143528,
'longitude' => -74.0059731,
'address' => 'New York, NY, USA',
'state' => 'New York',
'state_code' => 'NY',
'country' => 'United States',
'country_code' => 'US'
}
]
)
Geocoder::Lookup::Test.add_stub(
"Near with New York, NY", [
{
'latitude' => 40.9143528,
'longitude' => -74.1159731,
'address' => 'Near with New York, NY, USA',
'state' => 'Near with New York',
'state_code' => 'NY',
'country' => 'United States',
'country_code' => 'US'
}
]
)
Geocoder::Lookup::Test.add_stub(
"Far from New York, NY", [
{
'latitude' => 70.7143528,
'longitude' => 74.0059731,
'address' => 'Far from New York, NY, USA',
'state' => 'Far from New York',
'state_code' => 'NY',
'country' => 'United States',
'country_code' => 'US'
}
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment