I'm making use of the geokit-rails
gem to perform geolocation based on the IP address of the user who is logging in via #geocode_ip_address
(https://github.com/geokit/geokit-rails#ip-geocoding-helper).
However, I'm having a very hard time finding a way to test this via the Rails 5 IntegrationTest. I need a way to provide multiple remote IP addresses when simulating a login but I am stuck on the following issues:
- how to spoof an IP address (that will vary based on the user logging in)
- how to prevent making a ton of requests to the geolocation service
My original approach was to just skip it and place the :geo_location
information in the session
hash, however this seems to have gone away in Rails 5 per https://github.com/rails/rails/issues/23386.
Anybody have experience with a similar set-up?