From 3f5093cf4931755af56c09e50a563054d44ab8fd Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sat, 4 Apr 2026 19:29:33 +0000 Subject: [PATCH] Disable reverse geocoding in directions test --- test/system/directions_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/system/directions_test.rb b/test/system/directions_test.rb index 20923b699..6b42abe08 100644 --- a/test/system/directions_test.rb +++ b/test/system/directions_test.rb @@ -24,6 +24,7 @@ class DirectionsSystemTest < ApplicationSystemTestCase test "swaps route endpoints on reverse button click" do visit directions_path stub_straight_routing(:start_instruction => "Start popup text") + stub_disable_reverse_geocoding find_by_id("route_from").set("60 30").send_keys :enter find_by_id("route_to").set("61 31").send_keys :enter @@ -95,4 +96,19 @@ class DirectionsSystemTest < ApplicationSystemTestCase }); SCRIPT end + + def stub_disable_reverse_geocoding + execute_script <<~SCRIPT + $(() => { + const originalFetch = window.fetch; + window.fetch = function(input, init) { + if (!input?.url?.startsWith(OSM.NOMINATIM_URL)) return originalFetch.apply(this, arguments); + return Promise.resolve(new Response(JSON.stringify({}), { + status: 200, + headers: { "Content-Type": "application/json" } + })); + }; + }); + SCRIPT + end end -- 2.39.5