Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -826,4 +826,4 @@ DEPENDENCIES
webmock (~> 3.24)

BUNDLED WITH
2.6.5
2.6.6
8 changes: 5 additions & 3 deletions app/views/layouts/_lte_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@
<i class="fa fa-repeat text-aqua"></i><%= "Switch to: #{role.resource&.name || "Super Admin"}" %>
<% end %>
<% end %>
<% if current_user.has_cached_role?(Role::ORG_ADMIN, current_organization) %>
<% if current_user.has_cached_role?(Role::ORG_ADMIN, current_organization) %>
<div class="dropdown-divider"></div>
<%= link_to users_path, class:"dropdown-item" do %>
<i class="fas fa-users mr-2"></i> My Co-Workers
<% if current_user.has_cached_role?(:partner) %>
<%= link_to users_path, class:"dropdown-item" do %>
<i class="fas fa-users mr-2"></i> My Co-Workers
<% end %>
<% end %>
<%= link_to organization_path, class:"dropdown-item" do %>
<i class="fas fa-sitemap mr-2"></i> My Organization
Expand Down
12 changes: 12 additions & 0 deletions spec/system/navigation_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
end
end
end
it "dropdown menu does not show My Co-Workers" do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change this into a request test? System tests are only needed for tests that require interactivity.

Also, please remove the puts statements.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, I'll make those changes and get back to you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy, I hope I did this right. The gits and commits and pushes and merges get me all jumbled up.
I ended up creating a new request testing file for the user dropdown. Actually remembered to run the lint this time too, which passed with 0 offenses. The only tests that failed are the tests that I think are failing for everyone at the moment? Not sure what's normal, but they seemed completely irrelevant to what I was working on.

expect(user.has_role?(Role::ORG_ADMIN, user.organization)).to be true
expect(user.has_role?(:partner)).to be false
click_on user.display_name
puts "DROPDOWN LINKS:"
page.all(".dropdown-menu a").each do |link|
puts "- #{link.text.strip}"
end

expect(page).not_to have_link("My Co-Workers")
expect(page).not_to have_content("My Co-Workers")
end
end
end

Expand Down