dawarich/spec/support/geocoder_stubs.rb

23 lines
519 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
# Stub all Geocoder requests in tests
RSpec.configure do |config|
config.before(:each) do
# Create a generic stub for all Geocoder requests
2025-05-13 14:33:04 -04:00
allow(Geocoder).to receive(:search).and_return(
[
double(
data: {
'properties' => {
'countrycode' => 'US',
'country' => 'United States',
'state' => 'New York',
'name' => 'Test Location'
}
}
2025-05-13 14:33:04 -04:00
)
]
)
end
end