2025-05-13 13:43:02 -04:00
|
|
|
# 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 13:43:02 -04:00
|
|
|
}
|
2025-11-19 14:56:46 -05:00
|
|
|
},
|
|
|
|
|
latitude: 40.7128,
|
|
|
|
|
longitude: -74.0060
|
2025-05-13 14:33:04 -04:00
|
|
|
)
|
|
|
|
|
]
|
2025-05-13 13:43:02 -04:00
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
end
|