mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
24 lines
579 B
Ruby
24 lines
579 B
Ruby
# 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
|
|
allow(Geocoder).to receive(:search).and_return(
|
|
[
|
|
double(
|
|
data: {
|
|
'properties' => {
|
|
'countrycode' => 'US',
|
|
'country' => 'United States',
|
|
'state' => 'New York',
|
|
'name' => 'Test Location'
|
|
}
|
|
},
|
|
latitude: 40.7128,
|
|
longitude: -74.0060
|
|
)
|
|
]
|
|
)
|
|
end
|
|
end
|