I'm using the geocoder gem, but I don't know in which file I must paste this code. Can you tell me ?
That piece of code should be in the SETUP portion of whatever test framework you are using.
If using rspec, it should go here:
describe Something do
 before(:all) do 
  Geocoder.configure(:lookup => :test)
  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'
    }
   ]
  )
 end
end
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With