Browse Source

Maintenance: Stabilize OSM test.

Dusan Vuckovic 11 months ago
parent
commit
259aaf067d

+ 6 - 0
spec/lib/service/geo_location/osm_spec.rb

@@ -3,6 +3,12 @@
 require 'rails_helper'
 
 RSpec.describe Service::GeoLocation::Osm, :integration, use_vcr: true do
+  before do
+    # NB: Exclude possible geocoding matches, in order to always receive same coordinates for purpose of this test.
+    #   https://nominatim.org/release-docs/develop/api/Search/#result-restriction
+    stub_const('Service::GeoLocation::Osm::OSM_SEARCH_URL', "#{Service::GeoLocation::Osm::OSM_SEARCH_URL}&exclude_place_ids=158906443")
+  end
+
   describe '#geocode' do
     subject(:geocode) { described_class.geocode(address) }
 

File diff suppressed because it is too large
+ 2 - 2
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_german_address_example_at_spec_lib_service_geo_location_osm_spec_rb_19.yml


File diff suppressed because it is too large
+ 2 - 2
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_german_address_without_a_separator_between_street_zipcode_and_city_example_at_spec_lib_service_geo_location_osm_spec_rb_24.yml


+ 3 - 3
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_swiss_address_without_a_separator_between_street_zipcode_and_city_example_at_spec_lib_service_geo_location_osm_spec_rb_31.yml → test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_swiss_address_example_at_spec_lib_service_geo_location_osm_spec_rb_32.yml

@@ -2,7 +2,7 @@
 http_interactions:
 - request:
     method: get
-    uri: https://nominatim.openstreetmap.org/search?format=jsonv2&q=Martinsbruggstrasse%2035%209016%20St.%20Gallen
+    uri: https://nominatim.openstreetmap.org/search?exclude_place_ids=158906443&format=jsonv2&q=Martinsbruggstrasse%2035,%209016%20St.%20Gallen
     body:
       encoding: US-ASCII
       string: ''
@@ -23,7 +23,7 @@ http_interactions:
       Server:
       - nginx
       Date:
-      - Wed, 20 Mar 2024 11:47:28 GMT
+      - Fri, 22 Mar 2024 14:03:09 GMT
       Content-Type:
       - application/json; charset=utf-8
       Content-Length:
@@ -36,5 +36,5 @@ http_interactions:
       encoding: ASCII-8BIT
       string: !binary |-
         W3sicGxhY2VfaWQiOjYwNTkwNzExLCJsaWNlbmNlIjoiRGF0YSDCqSBPcGVuU3RyZWV0TWFwIGNvbnRyaWJ1dG9ycywgT0RiTCAxLjAuIGh0dHA6Ly9vc20ub3JnL2NvcHlyaWdodCIsIm9zbV90eXBlIjoid2F5Iiwib3NtX2lkIjozMDgyMzExNDIsImxhdCI6IjQ3LjQzNjY0NzY1IiwibG9uIjoiOS40MDk5MzQwNDc3NTEyMDkiLCJjYXRlZ29yeSI6ImJ1aWxkaW5nIiwidHlwZSI6InllcyIsInBsYWNlX3JhbmsiOjMwLCJpbXBvcnRhbmNlIjo5Ljk5OTk5OTk5OTk1NDQ5ZS0wNiwiYWRkcmVzc3R5cGUiOiJidWlsZGluZyIsIm5hbWUiOiIiLCJkaXNwbGF5X25hbWUiOiIzNSwgTWFydGluc2JydWdnc3RyYXNzZSwgTmV1ZG9yZiwgU3QuIEdhbGxlbiwgV2FobGtyZWlzIFN0LiBHYWxsZW4sIFN0LiBHYWxsZW4sIDkwMTYsIFNjaHdlaXovU3Vpc3NlL1N2aXp6ZXJhL1N2aXpyYSIsImJvdW5kaW5nYm94IjpbIjQ3LjQzNjU5MjkiLCI0Ny40MzY3MDI1IiwiOS40MDk4NTQwIiwiOS40MTAwMTQxIl19XQ==
-  recorded_at: Wed, 20 Mar 2024 11:47:28 GMT
+  recorded_at: Fri, 22 Mar 2024 14:03:09 GMT
 recorded_with: VCR 6.2.0

+ 3 - 3
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_swiss_address_example_at_spec_lib_service_geo_location_osm_spec_rb_26.yml → test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_geocode_with_a_swiss_address_without_a_separator_between_street_zipcode_and_city_example_at_spec_lib_service_geo_location_osm_spec_rb_37.yml

@@ -2,7 +2,7 @@
 http_interactions:
 - request:
     method: get
-    uri: https://nominatim.openstreetmap.org/search?format=jsonv2&q=Martinsbruggstrasse%2035,%209016%20St.%20Gallen
+    uri: https://nominatim.openstreetmap.org/search?exclude_place_ids=158906443&format=jsonv2&q=Martinsbruggstrasse%2035%209016%20St.%20Gallen
     body:
       encoding: US-ASCII
       string: ''
@@ -23,7 +23,7 @@ http_interactions:
       Server:
       - nginx
       Date:
-      - Wed, 20 Mar 2024 11:47:27 GMT
+      - Fri, 22 Mar 2024 14:03:10 GMT
       Content-Type:
       - application/json; charset=utf-8
       Content-Length:
@@ -36,5 +36,5 @@ http_interactions:
       encoding: ASCII-8BIT
       string: !binary |-
         W3sicGxhY2VfaWQiOjYwNTkwNzExLCJsaWNlbmNlIjoiRGF0YSDCqSBPcGVuU3RyZWV0TWFwIGNvbnRyaWJ1dG9ycywgT0RiTCAxLjAuIGh0dHA6Ly9vc20ub3JnL2NvcHlyaWdodCIsIm9zbV90eXBlIjoid2F5Iiwib3NtX2lkIjozMDgyMzExNDIsImxhdCI6IjQ3LjQzNjY0NzY1IiwibG9uIjoiOS40MDk5MzQwNDc3NTEyMDkiLCJjYXRlZ29yeSI6ImJ1aWxkaW5nIiwidHlwZSI6InllcyIsInBsYWNlX3JhbmsiOjMwLCJpbXBvcnRhbmNlIjo5Ljk5OTk5OTk5OTk1NDQ5ZS0wNiwiYWRkcmVzc3R5cGUiOiJidWlsZGluZyIsIm5hbWUiOiIiLCJkaXNwbGF5X25hbWUiOiIzNSwgTWFydGluc2JydWdnc3RyYXNzZSwgTmV1ZG9yZiwgU3QuIEdhbGxlbiwgV2FobGtyZWlzIFN0LiBHYWxsZW4sIFN0LiBHYWxsZW4sIDkwMTYsIFNjaHdlaXovU3Vpc3NlL1N2aXp6ZXJhL1N2aXpyYSIsImJvdW5kaW5nYm94IjpbIjQ3LjQzNjU5MjkiLCI0Ny40MzY3MDI1IiwiOS40MDk4NTQwIiwiOS40MTAwMTQxIl19XQ==
-  recorded_at: Wed, 20 Mar 2024 11:47:27 GMT
+  recorded_at: Fri, 22 Mar 2024 14:03:10 GMT
 recorded_with: VCR 6.2.0

+ 2 - 2
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_reverse_geocode_with_german_coordinates_example_at_spec_lib_service_geo_location_osm_spec_rb_44.yml → test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_reverse_geocode_with_german_coordinates_example_at_spec_lib_service_geo_location_osm_spec_rb_50.yml

@@ -23,7 +23,7 @@ http_interactions:
       Server:
       - nginx
       Date:
-      - Wed, 20 Mar 2024 11:46:42 GMT
+      - Fri, 22 Mar 2024 14:03:10 GMT
       Content-Type:
       - application/json; charset=utf-8
       Content-Length:
@@ -36,5 +36,5 @@ http_interactions:
       encoding: ASCII-8BIT
       string: !binary |-
         eyJwbGFjZV9pZCI6MTI4MTcyODAwLCJsaWNlbmNlIjoiRGF0YSDCqSBPcGVuU3RyZWV0TWFwIGNvbnRyaWJ1dG9ycywgT0RiTCAxLjAuIGh0dHA6Ly9vc20ub3JnL2NvcHlyaWdodCIsIm9zbV90eXBlIjoibm9kZSIsIm9zbV9pZCI6MjAwNzIyOTAyOSwibGF0IjoiNTIuNTIyMDUxNCIsImxvbiI6IjEzLjM4MzIwOTEiLCJjYXRlZ29yeSI6InBsYWNlIiwidHlwZSI6ImhvdXNlIiwicGxhY2VfcmFuayI6MzAsImltcG9ydGFuY2UiOjkuOTk5OTk5OTk5OTU0NDllLTA2LCJhZGRyZXNzdHlwZSI6InBsYWNlIiwibmFtZSI6IiIsImRpc3BsYXlfbmFtZSI6IjEzLCBNYXJpZW5zdHJhw59lLCBEb3JvdGhlZW5zdGFkdCwgTWl0dGUsIEJlcmxpbiwgMTAxMTcsIERldXRzY2hsYW5kIiwiYWRkcmVzcyI6eyJob3VzZV9udW1iZXIiOiIxMyIsInJvYWQiOiJNYXJpZW5zdHJhw59lIiwibmVpZ2hib3VyaG9vZCI6IkRvcm90aGVlbnN0YWR0Iiwic3VidXJiIjoiTWl0dGUiLCJib3JvdWdoIjoiTWl0dGUiLCJjaXR5IjoiQmVybGluIiwiSVNPMzE2Ni0yLWx2bDQiOiJERS1CRSIsInBvc3Rjb2RlIjoiMTAxMTciLCJjb3VudHJ5IjoiRGV1dHNjaGxhbmQiLCJjb3VudHJ5X2NvZGUiOiJkZSJ9LCJib3VuZGluZ2JveCI6WyI1Mi41MjIwMDE0IiwiNTIuNTIyMTAxNCIsIjEzLjM4MzE1OTEiLCIxMy4zODMyNTkxIl19
-  recorded_at: Wed, 20 Mar 2024 11:46:42 GMT
+  recorded_at: Fri, 22 Mar 2024 14:03:10 GMT
 recorded_with: VCR 6.2.0

+ 2 - 2
test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_reverse_geocode_with_swiss_coordinates_example_at_spec_lib_service_geo_location_osm_spec_rb_52.yml → test/data/vcr_cassettes/lib/service/geo_location/osm/service_geolocation_osm_reverse_geocode_with_swiss_coordinates_example_at_spec_lib_service_geo_location_osm_spec_rb_58.yml

@@ -23,7 +23,7 @@ http_interactions:
       Server:
       - nginx
       Date:
-      - Wed, 20 Mar 2024 11:46:42 GMT
+      - Fri, 22 Mar 2024 14:03:11 GMT
       Content-Type:
       - application/json; charset=utf-8
       Content-Length:
@@ -36,5 +36,5 @@ http_interactions:
       encoding: ASCII-8BIT
       string: !binary |-
         eyJwbGFjZV9pZCI6NjA1OTA3MTEsImxpY2VuY2UiOiJEYXRhIMKpIE9wZW5TdHJlZXRNYXAgY29udHJpYnV0b3JzLCBPRGJMIDEuMC4gaHR0cDovL29zbS5vcmcvY29weXJpZ2h0Iiwib3NtX3R5cGUiOiJ3YXkiLCJvc21faWQiOjMwODIzMTE0MiwibGF0IjoiNDcuNDM2NjQ3NjUiLCJsb24iOiI5LjQwOTkzNDA0Nzc1MTIwOSIsImNhdGVnb3J5IjoiYnVpbGRpbmciLCJ0eXBlIjoieWVzIiwicGxhY2VfcmFuayI6MzAsImltcG9ydGFuY2UiOjkuOTk5OTk5OTk5OTU0NDllLTA2LCJhZGRyZXNzdHlwZSI6ImJ1aWxkaW5nIiwibmFtZSI6IiIsImRpc3BsYXlfbmFtZSI6IjM1LCBNYXJ0aW5zYnJ1Z2dzdHJhc3NlLCBOZXVkb3JmLCBTdC4gR2FsbGVuLCBXYWhsa3JlaXMgU3QuIEdhbGxlbiwgU3QuIEdhbGxlbiwgOTAxNiwgU2Nod2Vpei9TdWlzc2UvU3ZpenplcmEvU3ZpenJhIiwiYWRkcmVzcyI6eyJob3VzZV9udW1iZXIiOiIzNSIsInJvYWQiOiJNYXJ0aW5zYnJ1Z2dzdHJhc3NlIiwic3VidXJiIjoiTmV1ZG9yZiIsInRvd24iOiJTdC4gR2FsbGVuIiwiY291bnR5IjoiV2FobGtyZWlzIFN0LiBHYWxsZW4iLCJzdGF0ZSI6IlN0LiBHYWxsZW4iLCJJU08zMTY2LTItbHZsNCI6IkNILVNHIiwicG9zdGNvZGUiOiI5MDE2IiwiY291bnRyeSI6IlNjaHdlaXovU3Vpc3NlL1N2aXp6ZXJhL1N2aXpyYSIsImNvdW50cnlfY29kZSI6ImNoIn0sImJvdW5kaW5nYm94IjpbIjQ3LjQzNjU5MjkiLCI0Ny40MzY3MDI1IiwiOS40MDk4NTQwIiwiOS40MTAwMTQxIl19
-  recorded_at: Wed, 20 Mar 2024 11:46:42 GMT
+  recorded_at: Fri, 22 Mar 2024 14:03:11 GMT
 recorded_with: VCR 6.2.0

Some files were not shown because too many files changed in this diff