Add system spec for managing everyone user role 2FA (#38911)

This commit is contained in:
Matt Jankowski 2026-05-06 04:36:42 -04:00 committed by GitHub
parent cb2e770584
commit aee0025ca3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,5 +74,19 @@ RSpec.describe 'Admin::Roles' do
expect(page)
.to have_title(I18n.t('admin.roles.title'))
end
it 'Manages the `everyone` user role' do
role = UserRole.everyone
visit edit_admin_role_path(role)
expect(page)
.to have_title(I18n.t('admin.roles.edit', name: I18n.t('admin.roles.everyone')))
.and have_text('This is the base role affecting all users')
# Update role attribute
check 'user_role_require_2fa' # Require 2FA for everyone
expect { click_on submit_button }
.to(change { role.reload.require_2fa }.to(true))
end
end
end