File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11<table class="table">
22 <thead>
33 <tr>
4- <th>Banks and Partners </th>
4+ <th>Roles </th>
55 <th>Name</th>
66 <th>Email</th>
77 <th class="text-right">Actions</th>
1111 <% @users.each do |user| %>
1212 <tr>
1313 <td>
14- <%= user.roles.map { |role| role.resource&.name } .compact.uniq.sort.join(', ' ) %>
14+ <%= user.roles.map { |role| "#{ role.name} (#{role. resource&.name.presence || "N/A"})" } .compact.uniq.sort.join(", " ) %>
1515 </td>
1616 <td><%= user.display_name %></td>
1717 <td><%= user.email %></td>
Original file line number Diff line number Diff line change 1212 end
1313
1414 describe "GET #index" do
15- it "renders index template and shows banks and partners correctly" do
15+ it "renders index template and shows roles and resources correctly" do
1616 AddRoleService.call(user_id: user.id, resource_type: Role::ORG_ADMIN, resource_id: organization.id)
1717 get admin_users_path
1818
1919 expect(response).to render_template(:index)
2020
2121 page = Nokogiri::HTML(response.body)
22- banks_and_partners = page.at_xpath("//*[contains(text(), \"#{user.email}\")]/../td[1]").text.strip
23- expect(banks_and_partners ).to eq("Org ABC, Partner XYZ")
22+ roles_and_resources = page.at_xpath("//*[contains(text(), \"#{user.email}\")]/../td[1]").text.strip
23+ expect(roles_and_resources ).to eq("org_admin ( Org ABC), org_user (Org ABC), partner ( Partner XYZ) ")
2424 end
2525 end
2626
You can’t perform that action at this time.
0 commit comments