File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
Original file line number Diff line number Diff line change 5252 end
5353 end
5454 end
55- it "dropdown menu does not show My Co-Workers" do
56- expect ( user . has_role? ( Role ::ORG_ADMIN , user . organization ) ) . to be true
57- expect ( user . has_role? ( :partner ) ) . to be false
58- click_on user . display_name
59- puts "DROPDOWN LINKS:"
60- page . all ( ".dropdown-menu a" ) . each do |link |
61- puts "- #{ link . text . strip } "
62- end
63-
64- expect ( page ) . not_to have_link ( "My Co-Workers" )
65- expect ( page ) . not_to have_content ( "My Co-Workers" )
66- end
6755 end
6856 end
6957
You can’t perform that action at this time.
0 commit comments