diff --git a/app/helpers/batch_invitation_permissions_helper.rb b/app/helpers/batch_invitation_permissions_helper.rb deleted file mode 100644 index 55235c0b68..0000000000 --- a/app/helpers/batch_invitation_permissions_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -module BatchInvitationPermissionsHelper - def formatted_permission_name(application_name, permission_name) - if permission_name == SupportedPermission::SIGNIN_NAME - "Has access to #{application_name}?" - else - permission_name - end - end -end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 81bd66a487..1aa626a0ad 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -88,4 +88,12 @@ def items_for_permission_checkboxes(application:, user: nil) def supported_permission_checkbox_id(application, permission) "user_application_#{application.id}_supported_permission_#{permission.id}" end + + def formatted_permission_name(application_name, permission_name) + if permission_name == SupportedPermission::SIGNIN_NAME + "Has access to #{application_name}?" + else + permission_name + end + end end diff --git a/test/helpers/batch_invitation_permissions_helper_test.rb b/test/helpers/batch_invitation_permissions_helper_test.rb deleted file mode 100644 index 80760db76b..0000000000 --- a/test/helpers/batch_invitation_permissions_helper_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -require "test_helper" - -class BatchInvitationPermissionsHelperTest < ActionView::TestCase - context "#formatted_permission_name" do - should "return the permission name if permission is not the signin permission" do - assert_equal "Editor", formatted_permission_name("Whitehall", "Editor") - end - - should "include the application name if permission is the signin permission" do - assert_equal "Has access to Whitehall?", formatted_permission_name("Whitehall", SupportedPermission::SIGNIN_NAME) - end - end -end diff --git a/test/helpers/users_helper_test.rb b/test/helpers/users_helper_test.rb index e4c6931e3d..eb9cd4046c 100644 --- a/test/helpers/users_helper_test.rb +++ b/test/helpers/users_helper_test.rb @@ -74,8 +74,6 @@ class UsersHelperTest < ActionView::TestCase end end - include BatchInvitationPermissionsHelper - context "#items_for_permission_checkboxes" do should "return permission options suitable for checkboxes component" do application = create(:application) @@ -114,4 +112,14 @@ class UsersHelperTest < ActionView::TestCase assert_equal expected_items, items end end + + context "#formatted_permission_name" do + should "return the permission name if permission is not the signin permission" do + assert_equal "Editor", formatted_permission_name("Whitehall", "Editor") + end + + should "include the application name if permission is the signin permission" do + assert_equal "Has access to Whitehall?", formatted_permission_name("Whitehall", SupportedPermission::SIGNIN_NAME) + end + end end