File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -831,4 +831,4 @@ DEPENDENCIES
831831 webmock (~> 3.24 )
832832
833833BUNDLED WITH
834- 2.6.5
834+ 2.6.6
Original file line number Diff line number Diff line change 5050 < i class ="fa fa-repeat text-aqua "> </ i > <%= "Switch to: #{ role . resource &.name || "Super Admin" } " %>
5151 <% end %>
5252 <% end %>
53- <% if current_user . has_cached_role? ( Role ::ORG_ADMIN , current_organization ) %>
53+ <% if current_user . has_cached_role? ( Role ::ORG_ADMIN , current_organization ) %>
5454 < div class ="dropdown-divider "> </ div >
55- <%= link_to users_path , class :"dropdown-item" do %>
56- < i class ="fas fa-users mr-2 "> </ i > My Co-Workers
55+ <% if current_user . has_cached_role? ( :partner ) %>
56+ <%= link_to users_path , class :"dropdown-item" do %>
57+ < i class ="fas fa-users mr-2 "> </ i > My Co-Workers
58+ <% end %>
5759 <% end %>
5860 <%= link_to organization_path , class :"dropdown-item" do %>
5961 < i class ="fas fa-sitemap mr-2 "> </ i > My Organization
Original file line number Diff line number Diff line change 1+ RSpec . describe "UsernameDropdown" , type : :request do
2+ let ( :organization ) { create ( :organization ) }
3+
4+ describe "My Co-Workers link visibility" do
5+ context "when user does not have partner role" do
6+ let ( :user ) { create ( :user , organization : organization ) }
7+
8+ before do
9+ user . add_role ( Role ::ORG_ADMIN , organization )
10+ sign_in ( user )
11+ end
12+
13+ it "does not show the My Co-Workers link" do
14+ get dashboard_path
15+ expect ( response . body ) . not_to include ( "My Co-Workers" )
16+ end
17+ end
18+ end
19+ end
You can’t perform that action at this time.
0 commit comments