From 7dc5d0ba80d7e0a3405b917bac46b3002dadd14b Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 20 Aug 2024 15:23:22 -0700 Subject: [PATCH] Create herbarium_form_system_test.rb --- test/system/herbarium_form_system_test.rb | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/system/herbarium_form_system_test.rb diff --git a/test/system/herbarium_form_system_test.rb b/test/system/herbarium_form_system_test.rb new file mode 100644 index 0000000000..c9ea1097be --- /dev/null +++ b/test/system/herbarium_form_system_test.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require("application_system_test_case") + +class HerbariumFormSystemTest < ApplicationSystemTestCase + def test_format_new_location_name + # browser = page.driver.browser + rolf = users("rolf") + login!(rolf) + + visit("/locations/new") + assert_selector("body.locations__new") + + assert_selector("#location_display_name") + assert_button(:form_locations_find_on_map.l) + # be sure the map is loaded! + assert_selector("#map_div div div") + fill_in("location_display_name", with: "genohlac gard france") + click_button(:form_locations_find_on_map.l) + + assert_selector("#location_display_name.geocoded") + assert_field("location_display_name", + with: "Génolhac, Gard, Occitanie, France") + + assert_field("location_north", with: "44.3726") + assert_field("location_east", with: "3.985") + assert_field("location_south", with: "44.3055") + assert_field("location_west", with: "3.9113") + assert_field("location_high", with: "1388.2098") + assert_field("location_low", with: "287.8201") + end +end