Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #191 from orendon/geocoding

Stub Geocoder calls on test environment
  • Loading branch information...
commit dab3d1daa194d27214a60f327bbfeaf0bad76e95 2 parents 5377c33 + eb11159
Oscar Rendón orendon authored

Showing 1 changed file with 18 additions and 0 deletions. Show diff stats Hide diff stats

  1. +18 0 config/environments/test.rb
18 config/environments/test.rb
@@ -32,4 +32,22 @@
32 32 config.active_support.deprecation = :stderr
33 33
34 34 OmniAuth.config.test_mode = true
  35 +
  36 + Geocoder.configure(:lookup => :test, :ip_lookup => :test)
  37 +
  38 + Geocoder::Lookup::Test.set_default_stub(
  39 + [
  40 + {
  41 + 'ip' => '123.123.123.123',
  42 + 'city' => 'new york city',
  43 + 'latitude' => 40.7143528,
  44 + 'longitude' => -74.0059731,
  45 + 'address' => 'New York, NY, USA',
  46 + 'state' => 'New York',
  47 + 'state_code' => 'NY',
  48 + 'country' => 'United States',
  49 + 'country_code' => 'US'
  50 + }
  51 + ]
  52 + )
35 53 end

0 comments on commit dab3d1d

Please sign in to comment.
Something went wrong with that request. Please try again.