Skip to content

Commit 49d7778

Browse files
committed
fix user login tests for users with names
1 parent 98dcc16 commit 49d7778

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/views/map/_header.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<% if user_signed_in? && current_user.admin? %>
2121
<%= link_to '<i class="fas fa-gear me-1"></i>Manage'.html_safe, manage_root_path %>
2222
<% elsif user_signed_in? %>
23-
<%= link_to '<i class="fas fa-user me-1"></i>'.html_safe + (current_user.name || 'Account').truncate(15), user_path %>
23+
<%= link_to '<i class="fas fa-user me-1"></i>'.html_safe + (current_user.name.presence || 'Account').truncate(15), user_path %>
2424
<% else %>
2525
<a href="#" class="drawer-link text-decoration-none" data-target="about">
2626
<%= image_tag 'logo_small.png', class: 'logo' %>

test/application_system_test_case.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def sign_in(user, controller: :map)
6868
assert_selector '.navbar', text: 'Logout'
6969
else
7070
# Wait for login to complete by checking for Account link
71-
assert_selector '.navigation', text: 'Account'
71+
assert_selector '.navigation', text: (user.name.presence || 'Account')
7272
find_by_id('hamburger-icon').click
7373
assert_selector '#hamburger-menu', text: 'Logout'
7474
end

0 commit comments

Comments
 (0)