apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

broken my tests if I don't have connection #114

Closed lucianosousa closed 12 years ago

lucianosousa commented 12 years ago

Well, I running my tests not connected in the internet, and, while one test should save a model, I received a error that is:

maps4rails::DirectionNetStatus in Controller#create

The request sent to google was invalid (not http success): http://maps.googleapis.com/maps/api/geocode/json?language=en&address=XXXX&sensor=false. Response was:

In my opinion, in this case, just only don't save the map, because, is a valid instance of my model.

Suggestions for this?

apneadiving commented 12 years ago

Well, there is necessary work on this: tests now clearly depend on internet connection which should be mocked.

lucianosousa commented 12 years ago

And, if I have a localhost app, running in a intranet. Given that I don't have connection? My app is broken. It's common??

apneadiving commented 12 years ago

Look here: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Model-Customization.

And set the process\geoding attribute depending on your environment