From 86a12b23ad0a4c99f947cbeb7956a22fdd77038f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 17 Nov 2025 01:59:17 +0100 Subject: [PATCH] Test admin map settings from the user's point of view People using these settings don't know about the hidden fields, but they do know about the fields that are actually displayed on the page. So we check that these fields are updated when the marker is updated. --- spec/system/admin/settings_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/system/admin/settings_spec.rb b/spec/system/admin/settings_spec.rb index 549a54b59..adde6dfb2 100644 --- a/spec/system/admin/settings_spec.rb +++ b/spec/system/admin/settings_spec.rb @@ -58,16 +58,17 @@ describe "Admin settings", :admin do '"Proposals and budget investments geolocation" ' \ 'on "Features" tab.' - expect(find("#latitude", visible: :hidden).value).to eq "51.48" - expect(find("#longitude", visible: :hidden).value).to eq "0.0" + expect(page).to have_field "Latitude", with: "51.48" + expect(page).to have_field "Longitude", with: "0.0" within "#map-form" do find("#admin-map").click click_button "Update" end - expect(find("#latitude", visible: :hidden).value).not_to eq "51.48" expect(page).to have_content "Map configuration updated successfully" + expect(page).to have_field "Latitude" + expect(page).not_to have_field "Latitude", with: "51.48" end end