diff --git a/app/helpers/api_users_helper.rb b/app/helpers/api_users_helper.rb index 5627ccb15..65d3d78f4 100644 --- a/app/helpers/api_users_helper.rb +++ b/app/helpers/api_users_helper.rb @@ -8,15 +8,13 @@ def api_user_name(user) user.suspended? ? content_tag(:del, anchor_tag) : anchor_tag end - def permissions_by_application(user) + def application_list(user) content_tag(:ul, class: "govuk-list") do safe_join( visible_applications(user).map do |application| next unless user.permissions_for(application).any? - content_tag(:li) do - content_tag(:abbr, application.name, title: "Permissions: #{user.permissions_for(application).to_sentence}") - end + content_tag(:li, application.name) end, ) end diff --git a/app/views/api_users/index.html.erb b/app/views/api_users/index.html.erb index 32fc2851c..4070766db 100644 --- a/app/views/api_users/index.html.erb +++ b/app/views/api_users/index.html.erb @@ -36,7 +36,7 @@ text: user.email, }, { - text: permissions_by_application(user), + text: application_list(user), }, { text: user.suspended? ? "Yes" : "No", diff --git a/test/integration/manage_api_users_test.rb b/test/integration/manage_api_users_test.rb index 3f7524553..e6874f1d7 100644 --- a/test/integration/manage_api_users_test.rb +++ b/test/integration/manage_api_users_test.rb @@ -19,7 +19,7 @@ class ManageApiUsersTest < ActionDispatch::IntegrationTest assert page.has_selector?("td", text: @api_user.name) assert page.has_selector?("td", text: @api_user.email) - assert page.has_selector?("abbr", text: @application.name) + assert page.has_selector?("td", text: @application.name) assert page.has_selector?("td:last-child", text: "No") # suspended? end @@ -54,16 +54,26 @@ class ManageApiUsersTest < ActionDispatch::IntegrationTest select "Managing Editor", from: "Permissions for Whitehall" click_button "Update API user" - assert page.has_selector?("abbr[title='Permissions: Managing Editor and signin']", text: "Whitehall") - click_link @api_user.name + within "table#editable-permissions" do + # The existence of the