RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
894 stars 261 forks source link

Fix preview not loading after pressing guess button #369

Closed stardust66 closed 6 years ago

stardust66 commented 7 years ago

Context

Summary of Changes

Checklist

DeeDeeG commented 7 years ago

I found out that the Preview button fails when the "Restroom Name" field (on the new restroom form) isn't empty. (This happens because we get a bad response from the Maps API).

In the test file, preview_steps.rb, the restroom name is filled out (with the text "Vancouver restroom" for the name).

So, given that the name field isn't empty, and due to the Maps API not liking the request we send out, at the moment the Geolocation fails and the test subsequently fails.

I looked into it a bit further, and the Restroom Name value gets passed to Google as part of the request we send out. I assume if that is not sent, we'll get a good response.

DeeDeeG commented 7 years ago

Seems like changing this line should fix it: new.coffee, line 44 or so

address = "#{name}, #{street}, #{city}, #{state}, #{country}"

mi-wood commented 6 years ago

Merging to a separate branch so I can fix the other issue