Skip to content

Commit

Permalink
fix test. Remove "manage species lists" link if user has none
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Jan 20, 2024
1 parent eea46cc commit 465b4ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/helpers/tabs/observations_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ def send_observer_question_tab(obs)
end

# Used in the lists panel
# N+1: this looks up User.current.species_lists. Mercifully quick.
def observation_manage_lists_tab(obs, user)
return unless user
return unless user&.species_list_ids&.any?

[:show_observation_manage_species_lists.l,
add_query_param(edit_observation_species_lists_path(obs.id)),
Expand Down
2 changes: 1 addition & 1 deletion test/integration/capybara/namings_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_proposing_names
login(namer, session: namer_session)
assert_false(namer_session.has_link?(class: /edit_naming/))
assert_false(namer_session.has_selector?(class: /destroy_naming_link_/))
namer_session.click_link(class: "propose-naming-link")
namer_session.first(class: "propose-naming-link").click

# naming = namer_session.create_name(obs, text_name)
namer_session.assert_selector("body.namings__new")
Expand Down

0 comments on commit 465b4ec

Please sign in to comment.