]> git.openstreetmap.org Git - rails.git/blobdiff - test/lib/nominatim_test.rb
Merge remote-tracking branch 'upstream/pull/5104'
[rails.git] / test / lib / nominatim_test.rb
index e7cb6fb593b6fa5a43553e46875e076b41ba066b..1ac775a880ea3683730290f6efc91938a8edf4a9 100644 (file)
@@ -5,27 +5,25 @@ class NominatimTest < ActiveSupport::TestCase
     stub_request(:get, %r{^https://nominatim\.example\.com/reverse\?})
       .to_return(:body => "<reversegeocode><result>Target location</result></reversegeocode>")
 
-    with_settings(:nominatim_url => "https://nominatim.example.com/",
-                  :server_url => "osm-website.example.com") do
+    with_settings(:nominatim_url => "https://nominatim.example.com/") do
       location = Nominatim.describe_location(60, 30, 10, "en")
       assert_equal "Target location", location
     end
 
     assert_requested :get, "https://nominatim.example.com/reverse?lat=60&lon=30&zoom=10&accept-language=en",
-                     :headers => { "User-Agent" => "osm-website.example.com" }
+                     :headers => { "User-Agent" => Settings.server_url }
   end
 
   def test_describe_location_no_result
     stub_request(:get, %r{^https://nominatim\.example\.com/reverse\?})
       .to_return(:body => "<reversegeocode><error>Unable to geocode</error></reversegeocode>")
 
-    with_settings(:nominatim_url => "https://nominatim.example.com/",
-                  :server_url => "osm-website.example.com") do
+    with_settings(:nominatim_url => "https://nominatim.example.com/") do
       location = Nominatim.describe_location(1, 2, 14, "en")
       assert_equal "1.000, 2.000", location
     end
 
     assert_requested :get, "https://nominatim.example.com/reverse?lat=1&lon=2&zoom=14&accept-language=en",
-                     :headers => { "User-Agent" => "osm-website.example.com" }
+                     :headers => { "User-Agent" => Settings.server_url }
   end
 end