From 597a21eca9c518c7ccc72bb42e9c48fbdc83f02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 12 Oct 2024 21:43:17 +0200 Subject: [PATCH] Add alt attribute to map images We were using it on the map displayed on the sidebar, but we weren't using it in the other places were the map is rendered. --- app/views/budgets/groups/show.html.erb | 2 +- app/views/proposals/map.html.erb | 2 +- spec/system/admin/site_customization/images_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/budgets/groups/show.html.erb b/app/views/budgets/groups/show.html.erb index f0687630a..5fca4acd6 100644 --- a/app/views/budgets/groups/show.html.erb +++ b/app/views/budgets/groups/show.html.erb @@ -23,6 +23,6 @@
- <%= image_tag(image_path_for("map.jpg")) %> + <%= image_tag(image_path_for("map.jpg"), alt: t("shared.tags_cloud.districts_list")) %>
diff --git a/app/views/proposals/map.html.erb b/app/views/proposals/map.html.erb index dde4a610f..261cd49ef 100644 --- a/app/views/proposals/map.html.erb +++ b/app/views/proposals/map.html.erb @@ -13,7 +13,7 @@
- <%= image_tag(image_path_for("map.jpg"), usemap: "#map") %> + <%= image_tag(image_path_for("map.jpg"), alt: t("shared.tags_cloud.districts_list"), usemap: "#map") %>
diff --git a/spec/system/admin/site_customization/images_spec.rb b/spec/system/admin/site_customization/images_spec.rb index 3ed98ffa6..10ceb3149 100644 --- a/spec/system/admin/site_customization/images_spec.rb +++ b/spec/system/admin/site_customization/images_spec.rb @@ -45,19 +45,19 @@ describe "Admin custom images", :admin do visit proposals_path within("#map") do - expect(page).to have_css("img[src*='custom_map.jpg']") + expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']") end visit map_proposals_path within(".show-for-medium") do - expect(page).to have_css("img[src*='custom_map.jpg']") + expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']") end visit budget_group_path(budget, group) within(".show-for-medium") do - expect(page).to have_css("img[src*='custom_map.jpg']") + expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']") end end