Skip to content

Commit

Permalink
Check location creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Aug 24, 2024
1 parent f4e358a commit 79494f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/views/controllers/herbaria/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ map = @herbarium.location
<% if map %>
<div class="col-xs-12 col-sm-4 mt-3" style="max-width:320px">
<%= 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 %>
</div>
<% end %>
</div><!--.row-->
Expand Down
14 changes: 12 additions & 2 deletions test/system/herbarium_form_system_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

0 comments on commit 79494f2

Please sign in to comment.