RailsCasts Pro episodes are now free!

Learn more or hide this

John Hinnegan's Profile

GitHub User: softwaregravy

Comments by John Hinnegan

Avatar

Using rspec, I'm doing the following: (Geocoded Zipcode stores zipcode->lat/lon pairs)

ruby
gz = GeocodedZipcode.new(:zipcode => "12345", :latitude => "50.00", :longitude => "-75.00")
gz.stub!(:geocode).and_return(true)
gz.save!

I'm really not happy with this solution. Gotta be a better way.

Avatar

How are people who are using this testing? I'm trying to find the best place to insert a hook to prevent actual geocoding during my tests.