geocoder icon indicating copy to clipboard operation
geocoder copied to clipboard

Rspec configure overriden

Open benj-p opened this issue 4 months ago • 1 comments

Expected behavior

Geocoder config in Rspec.configure should take precedence in test environment.

Actual behavior

I'm using :mapbox as a default lookup in my app but there's one specific callback where I need to use Nominatim instead (Geocoder.search([latitude, longitude], lookup: :nominatim)).

However, because of this, despite having setup Geocoder to use :test in my Rspec settings (Geocoder.configure(lookup: :test, ip_lookup: :test)) it's using Nominatim when that callback is executed. Removing lookup: :nominatim does make it use the :test lookup in the test environment.

Environment info

  • Geocoder version: 1.8.1
  • Rails version: 7.1.3

benj-p avatar Sep 30 '24 08:09 benj-p