diff --git a/app/views/controllers/herbaria/show.html.erb b/app/views/controllers/herbaria/show.html.erb index 88030fedaa..3c22f59c9b 100644 --- a/app/views/controllers/herbaria/show.html.erb +++ b/app/views/controllers/herbaria/show.html.erb @@ -69,7 +69,9 @@ map = @herbarium.location <% if map %>
<%= tag.div(class: "mb-3") { make_map(objects: [@herbarium.location]) } %> - <%= tag.p("#{:LOCATION.l}: #{@herbarium.location.text_name}") %> + <%= tag.p(id: "herbarium_location") do + "#{:LOCATION.l}: #{@herbarium.location.text_name}" + end %>
<% end %> diff --git a/test/system/herbarium_form_system_test.rb b/test/system/herbarium_form_system_test.rb index a1bae9e630..796ed576af 100644 --- a/test/system/herbarium_form_system_test.rb +++ b/test/system/herbarium_form_system_test.rb @@ -14,8 +14,6 @@ def test_fungarium_new_location assert_selector("#herbarium_place_name") fill_in("herbarium_place_name", with: "genohlac gard france") assert_link(:form_observations_create_locality.l) - # be sure the map is loaded! - # assert_selector("#map_div div div") click_link(:form_observations_create_locality.l) assert_selector("#herbarium_place_name.geocoded") @@ -29,5 +27,17 @@ def test_fungarium_new_location assert_field("location_west", with: "3.9113", type: :hidden) assert_field("location_high", with: "1388.2098", type: :hidden) assert_field("location_low", with: "287.8201", type: :hidden) + + within("#herbarium_form") do + fill_in("herbarium_name", with: "Herbarium des Cévennes") + fill_in("herbarium_code", with: "CEV") + click_commit + end + + # assert_no_selector("#modal_herbarium") + assert_selector("body.herbaria__show") + assert_selector("h1", text: "Herbarium des Cévennes (CEV)") + assert_selector("#herbarium_location", + text: "Génolhac, Gard, Occitanie, France") end end