+ <%= button_to 'Clear messages and calls', test_telephony_path, method: :delete, class: 'usa-button' %>
+
+
+
Messages
- <% @messages.each do |message| %>
-
-
- To: <%= message.to %>
-
-
- Body: <%= message.body %>
-
-
- Sent at: <%= message.sent_at.strftime(t('time.formats.event_timestamp')) %>
-
+ <% @messages.each do |message| %>
+
+
+ To: <%= message.to %>
+
+
+ Body: <%= message.body %>
+
+
+ Sent at: <%= message.sent_at.strftime(t('time.formats.event_timestamp')) %>
+
+
+ <% end %>
- <% end %>
-
-
-
Calls
+
+
Calls
- <% @calls.each do |call| %>
-
-
- To: <%= call.to %>
-
-
- Body: <%= call.body %>
-
-
- Sent at: <%= call.sent_at.strftime(t('time.formats.event_timestamp')) %>
-
+ <% @calls.each do |call| %>
+
+
+ To: <%= call.to %>
+
+
+ Body: <%= call.body %>
+
+
+ Sent at: <%= call.sent_at.strftime(t('time.formats.event_timestamp')) %>
+
+
+ <% end %>
- <% end %>
+
diff --git a/app/views/users/webauthn_setup/delete.html.erb b/app/views/users/webauthn_setup/delete.html.erb
index 44693a6d163..d4355d28cba 100644
--- a/app/views/users/webauthn_setup/delete.html.erb
+++ b/app/views/users/webauthn_setup/delete.html.erb
@@ -16,5 +16,5 @@
class: 'btn btn-primary col-6 mb2 p2 rounded') %>
<%= link_to t('links.cancel'),
- account_path,
+ account_two_factor_authentication_path,
class: 'btn col-6 p2 rounded-lg border border-blue blue border-box center' %>
diff --git a/config/locales/account/en.yml b/config/locales/account/en.yml
index 2829d744fb6..5aa9a9dfcf2 100644
--- a/config/locales/account/en.yml
+++ b/config/locales/account/en.yml
@@ -2,11 +2,11 @@
en:
account:
connected_apps:
- associated: Associated %{timestamp}
+ associated: Connected %{timestamp}
+ description: With your login.gov account, you can securely connect to multiple
+ government accounts online. Below is a list of all the accounts you currently
+ have connected.
forget_all_browsers:
- description: Use this to disconnect all remembered browers from your login.gov
- account
- link_title: Forget all browsers
longer_description: Once you choose to ‘forget all browsers,’ we’ll need additional
information to know that it’s actually you signing in to your account. We’ll
ask for a multi-factor authentication method (such as text/SMS code or a security
@@ -17,8 +17,8 @@ en:
auth_app_enabled: enabled
backup_code_confirm_delete: Yes, delete codes
backup_code_confirm_regenerate: Yes, regenerate codes
- backup_codes_exist: generated
- backup_codes_no_exist: not generated
+ backup_codes_exist: Generated
+ backup_codes_no_exist: Not generated
default: default
device: "%{browser} on %{os}"
dob: Date of birth
@@ -26,7 +26,6 @@ en:
email_add: "+ Add email"
email_addresses: Email addresses
full_name: Full name
- login: Login Information
password: Password
phone: Phone numbers
phone_add: "+ Add phone"
@@ -65,11 +64,30 @@ en:
ial2: If you have added your PIV/CAC card to your account, you may use it
instead of your email. You will need to provide your password to unlock
your profile.
+ navigation:
+ access_services: Access your government benefits and services from your login.gov
+ account.
+ add_authentication_apps: Add authentication apps
+ add_email: Add email address
+ add_federal_id: Add Federal Employee ID
+ add_phone_number: Add phone number
+ add_security_key: Add security key
+ connected_accounts: Your connected accounts
+ customer_support: Customer support
+ delete_account: Delete account
+ edit_password: Edit password
+ forget_browsers: Forget all browsers
+ get_backup_codes: Get backup codes
+ history: History
+ learn_more: Learn more about login.gov
+ menu: Menu
+ two_factor_authentication: Two-factor authentication
+ your_account: Your Account
re_verify:
banner: We've hidden your profile information to protect your privacy.
footer: Authenticate to view your information.
revoke_consent:
- link_title: Revoke Consent
+ link_title: Disconnect
longer_description_html: Your information will no longer be shared with %{service_provider}.
To access %{service_provider} in the future, you must give your consent to
share your information. You can give consent by going to the %{service_provider}
diff --git a/config/locales/account/es.yml b/config/locales/account/es.yml
index 794526f0cde..6b007a95693 100644
--- a/config/locales/account/es.yml
+++ b/config/locales/account/es.yml
@@ -2,11 +2,11 @@
es:
account:
connected_apps:
- associated: Asociado %{timestamp}
+ associated: Conectado %{timestamp}
+ description: Con su cuenta login.gov, puede conectarse de manera segura a múltiples
+ cuentas gubernamentales en línea. A continuación se muestra una lista de todas
+ las cuentas que tiene actualmente conectadas.
forget_all_browsers:
- description: Use esto para desconectar todos los navegadores recordados de su
- cuenta login.gov
- link_title: Olvídate de todos los navegadores
longer_description: Una vez que elija "olvidar todos los navegadores", necesitaremos
información adicional para saber que en realidad está iniciando sesión en
su cuenta. Le pediremos un método de autenticación de múltiples factores (como
@@ -18,8 +18,8 @@ es:
auth_app_enabled: permitido
backup_code_confirm_delete: Sí, borrar códigos
backup_code_confirm_regenerate: Sí, regenerar códigos.
- backup_codes_exist: generado
- backup_codes_no_exist: no generado
+ backup_codes_exist: Generado
+ backup_codes_no_exist: No generado
default: defecto
device: "%{browser} en %{os}"
dob: Fecha de nacimiento
@@ -27,7 +27,6 @@ es:
email_add: "+ Agregar email"
email_addresses: Correos electrónicos
full_name: Nombre completo
- login: Información para iniciar sesión
password: Contraseña
phone: Teléfono
phone_add: "+ Añadir teléfono"
@@ -67,11 +66,30 @@ es:
ial2: Si ha agregado su tarjeta PIV / CAC a su cuenta, puede usarla en lugar
de su correo electrónico. Deberá proporcionar su contraseña para desbloquear
su perfil.
+ navigation:
+ access_services: Acceda a los beneficios y servicios de su gobierno desde su
+ cuenta login.gov.
+ add_authentication_apps: Agregar aplicaciones de autenticación
+ add_email: Agregar dirección de correo electrónico
+ add_federal_id: Agregar identificación de empleado federal
+ add_phone_number: Agregar el número de teléfono
+ add_security_key: Agregar llave de seguridad
+ connected_accounts: Tus cuentas conectadas
+ customer_support: Atención al cliente
+ delete_account: Borrar cuenta
+ edit_password: Editar contraseña
+ forget_browsers: Olvídese de todos los navegadores
+ get_backup_codes: Obtener códigos de respaldo
+ history: Historia
+ learn_more: Obtenga más información sobre login.gov
+ menu: Menú
+ two_factor_authentication: Autenticación de dos factores
+ your_account: Su cuenta
re_verify:
banner: Hemos ocultado la información de su perfil para proteger su privacidad.
footer: Autentíquese nuevamente para ver la información de su perfil
revoke_consent:
- link_title: Revocar consentimiento
+ link_title: Desconectar
longer_description_html: Su información ya no se compartirá con %{service_provider}.
Para acceder a %{service_provider} en el futuro, debe dar su consentimiento
para compartir su información. Puede dar su consentimiento yendo al sitio
diff --git a/config/locales/account/fr.yml b/config/locales/account/fr.yml
index d94787bef1d..ae0787d7597 100644
--- a/config/locales/account/fr.yml
+++ b/config/locales/account/fr.yml
@@ -2,11 +2,11 @@
fr:
account:
connected_apps:
- associated: Associé %{timestamp}
+ associated: Lié %{timestamp}
+ description: Avec votre compte login.gov, vous pouvez vous connecter en toute
+ sécurité à plusieurs comptes gouvernementaux en ligne. Vous trouverez ci-dessous
+ une liste de tous les comptes actuellement connectés.
forget_all_browsers:
- description: Utilisez-le pour déconnecter tous les navigateurs mémorisés de
- votre compte login.gov
- link_title: Oubliez tous les navigateurs
longer_description: Une fois que vous aurez choisi "d'oublier tous les navigateurs",
nous aurons besoin d'informations supplémentaires pour savoir qu'il s'agit
bien de votre connexion à votre compte. Nous vous demanderons une méthode
@@ -18,8 +18,8 @@ fr:
auth_app_enabled: activée
backup_code_confirm_delete: Oui, supprimer les codes
backup_code_confirm_regenerate: Oui, régénérer les codes
- backup_codes_exist: généré
- backup_codes_no_exist: non généré
+ backup_codes_exist: Généré
+ backup_codes_no_exist: Non généré
default: défaut
device: "%{browser} sur %{os}"
dob: Date de naissance
@@ -27,7 +27,6 @@ fr:
email_add: "+ Ajouter un email"
email_addresses: Adresses courriel
full_name: Nom complet
- login: Information de connexion
password: Mot de passe
phone: Numéro de téléphone
phone_add: "+ Ajouter un téléphone"
@@ -68,13 +67,32 @@ fr:
ial2: Si vous avez ajouté votre carte PIV / CAC à votre compte, vous pouvez
l’utiliser à la place de votre adresse courriel. Vous devrez fournir votre
mot de passe pour déverrouiller votre profil.
+ navigation:
+ access_services: Accédez à vos avantages et services gouvernementaux depuis
+ votre compte login.gov.
+ add_authentication_apps: Ajouter des applications d'authentification
+ add_email: Ajouter une adresse e-mail
+ add_federal_id: Ajouter un identifiant d'employé fédéral
+ add_phone_number: Ajouter un numéro de téléphone
+ add_security_key: Ajouter une clé de sécurité
+ connected_accounts: Vos comptes connectés
+ customer_support: Service client
+ delete_account: Supprimer le compte
+ edit_password: Modifier le mot de passe
+ forget_browsers: Oubliez tous les navigateurs
+ get_backup_codes: Obtenez des codes de secours
+ history: L'histoire
+ learn_more: En savoir plus sur login.gov
+ menu: Menu
+ two_factor_authentication: Authentification à deux facteurs
+ your_account: Votre compte
re_verify:
banner: Nous avons masqué les informations de votre profil pour protéger votre
vie privée.
footer: Veuillez vous authentifier à nouveau pour afficher les informations
de votre profil
revoke_consent:
- link_title: Révoquer le consentement
+ link_title: Déconnecter
longer_description_html: Vos informations ne seront plus partagées avec %{service_provider}.
Pour accéder à %{service_provider} à l'avenir, vous devez donner votre consentement
pour partager vos informations. Vous pouvez donner votre consentement en allant
diff --git a/config/locales/forms/en.yml b/config/locales/forms/en.yml
index faa317340ae..28f18775df4 100644
--- a/config/locales/forms/en.yml
+++ b/config/locales/forms/en.yml
@@ -28,7 +28,7 @@ en:
code can only be used once. After you’ve used all 10 codes, we’ll give you
10 new codes. Keep your codes as safe as your password."
subtitle: Your backup codes
- title: Backup Codes
+ title: Backup codes
backup_code_regenerate:
caution: If you regenerate your backup codes you will receive a new set of backup
codes. Your original backup codes will no longer be valid.
diff --git a/config/locales/headings/en.yml b/config/locales/headings/en.yml
index 2a36040360d..9326b88ab2d 100644
--- a/config/locales/headings/en.yml
+++ b/config/locales/headings/en.yml
@@ -2,11 +2,12 @@
en:
headings:
account:
- account_history: Account history
- account_management: Account Management
- connected_apps: Applications
+ activity: Activity
+ authentication_apps: Authentication apps
+ connected_accounts: Your connected accounts
devices: Devices
events: Events
+ federal_employee_id: Federal Employee ID
login_info: Your account
profile_info: Profile information
reactivate: Reactivate your account
diff --git a/config/locales/headings/es.yml b/config/locales/headings/es.yml
index 4df70e3bb84..9cab4f15067 100644
--- a/config/locales/headings/es.yml
+++ b/config/locales/headings/es.yml
@@ -2,11 +2,12 @@
es:
headings:
account:
- account_history: Historial de cuenta
- account_management: Manejo de cuenta
- connected_apps: Aplicaciones
+ activity: Actividad
+ authentication_apps: Aplicaciones de autenticación
+ connected_accounts: Tus cuentas conectadas
devices: Dispositivos
events: Eventos
+ federal_employee_id: Identificación de empleado federal
login_info: Su cuenta
profile_info: Información de perfil
reactivate: Reactive su cuenta
diff --git a/config/locales/headings/fr.yml b/config/locales/headings/fr.yml
index 27d369ccc8a..069b0a31528 100644
--- a/config/locales/headings/fr.yml
+++ b/config/locales/headings/fr.yml
@@ -2,11 +2,12 @@
fr:
headings:
account:
- account_history: Historique du compte
- account_management: Gestion de compte
- connected_apps: Applications
+ activity: Activité
+ authentication_apps: Applications d'authentification
+ connected_accounts: Vos comptes connectés
devices: Dispositifs
events: Événements
+ federal_employee_id: Identification des employés fédéraux
login_info: Votre compte
profile_info: Information du profil
reactivate: Réactivez votre compte
diff --git a/config/locales/titles/en.yml b/config/locales/titles/en.yml
index 64f37c8a142..4a8d159db16 100644
--- a/config/locales/titles/en.yml
+++ b/config/locales/titles/en.yml
@@ -47,7 +47,6 @@ en:
reactivate_account: Reactivate your account
registrations:
new: Sign up for an account
- remembered_browsers: Remembered browsers
revoke_consent: Revoke Consent
sign_up:
completion_html: You've %{accent} with %{app}
diff --git a/config/locales/titles/es.yml b/config/locales/titles/es.yml
index c6d0b43fa29..889dd00c76d 100644
--- a/config/locales/titles/es.yml
+++ b/config/locales/titles/es.yml
@@ -48,7 +48,6 @@ es:
reactivate_account: Reactive su cuenta
registrations:
new: Regístrese para una cuenta
- remembered_browsers: Navegadores recordados
revoke_consent: Revocar consentimiento
sign_up:
completion_html: Tiene %{accent} con %{app}
diff --git a/config/locales/titles/fr.yml b/config/locales/titles/fr.yml
index 2596b78addb..1ffbd3728b0 100644
--- a/config/locales/titles/fr.yml
+++ b/config/locales/titles/fr.yml
@@ -47,7 +47,6 @@ fr:
reactivate_account: Réactiver le profil
registrations:
new: S'inscrire et créer un compte
- remembered_browsers: Navigateurs mémorisés
revoke_consent: Révoquer le consentement
sign_up:
completion_html: Vous avez %{accent} avec %{app}
diff --git a/config/routes.rb b/config/routes.rb
index e25eff052d3..02876cfe65f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -158,9 +158,11 @@
as: :risc_configuration
get '/account' => 'accounts#show'
+ get '/account/connected_accounts' => 'accounts/connected_accounts#show'
get '/account/devices/:id/events' => 'events#show', as: :account_events
get '/account/delete' => 'users/delete#show', as: :account_delete
post '/account/delete' => 'users/delete#delete'
+ get '/account/history' => 'accounts/history#show'
get '/account/reactivate/start' => 'reactivate_account#index', as: :reactivate_account
put '/account/reactivate/start' => 'reactivate_account#update'
get '/account/reactivate/verify_password' => 'users/verify_password#new', as: :verify_password
@@ -169,6 +171,7 @@
as: :verify_personal_key
post '/account/reactivate/verify_personal_key' => 'users/verify_personal_key#create',
as: :create_verify_personal_key
+ get '/account/two_factor_authentication' => 'accounts/two_factor_authentication#show'
get '/events/disavow' => 'event_disavowal#new', as: :event_disavowal
post '/events/disavow' => 'event_disavowal#create', as: :events_disavowal
diff --git a/spec/controllers/users/piv_cac_authentication_setup_controller_spec.rb b/spec/controllers/users/piv_cac_authentication_setup_controller_spec.rb
index 3a26e1600ea..34cc44cebab 100644
--- a/spec/controllers/users/piv_cac_authentication_setup_controller_spec.rb
+++ b/spec/controllers/users/piv_cac_authentication_setup_controller_spec.rb
@@ -129,9 +129,9 @@
end
describe 'DELETE delete' do
- it 'redirects to account page' do
+ it 'redirects to account 2FA page' do
delete :delete
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
end
end
end
@@ -151,7 +151,7 @@
it 'redirects to account page' do
delete :delete, params: { id: piv_cac_configuration_id }
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
end
it 'removes the piv/cac association' do
@@ -177,7 +177,7 @@
delete :delete, params: { id: piv_cac_configuration_id }
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
expect(user.reload.piv_cac_configurations.first.x509_dn_uuid).to_not be_nil
end
end
diff --git a/spec/controllers/users/service_provider_revoke_controller_spec.rb b/spec/controllers/users/service_provider_revoke_controller_spec.rb
index 62823f9eb19..eeea441c517 100644
--- a/spec/controllers/users/service_provider_revoke_controller_spec.rb
+++ b/spec/controllers/users/service_provider_revoke_controller_spec.rb
@@ -42,7 +42,7 @@
it 'does not error, just redirects to the account page' do
subject
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_connected_accounts_path)
end
end
@@ -51,7 +51,7 @@
it 'does not error, just redirects to the account page' do
subject
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_connected_accounts_path)
end
end
end
@@ -64,7 +64,7 @@
expect { Timecop.freeze(now) { subject } }.
to change { @identity.reload.deleted_at&.to_i }.
from(nil).to(now.to_i)
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_connected_accounts_path)
end
it 'logs an analytics event for revoking' do
@@ -80,7 +80,7 @@
it 'does not error, just redirects to the account page' do
subject
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_connected_accounts_path)
end
end
@@ -89,7 +89,7 @@
it 'does not error, just redirects to the account page' do
subject
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_connected_accounts_path)
end
end
end
diff --git a/spec/controllers/users/totp_setup_controller_spec.rb b/spec/controllers/users/totp_setup_controller_spec.rb
index 1a34918b659..b76131138bf 100644
--- a/spec/controllers/users/totp_setup_controller_spec.rb
+++ b/spec/controllers/users/totp_setup_controller_spec.rb
@@ -230,7 +230,7 @@
delete :disable
expect(user.reload.totp_enabled?).to be(false)
- expect(response).to redirect_to(account_path)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
expect(flash[:success]).to eq t('notices.totp_disabled')
expect(@analytics).to have_received(:track_event).with(Analytics::TOTP_USER_DISABLED)
expect(subject).to have_received(:create_user_event).with(:authenticator_disabled)
@@ -243,7 +243,7 @@
sign_in user
delete :disable
- expect(response).to redirect_to(account_path)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
end
end
end
diff --git a/spec/controllers/users/webauthn_setup_controller_spec.rb b/spec/controllers/users/webauthn_setup_controller_spec.rb
index eab0400bcd0..b6415e1a8b3 100644
--- a/spec/controllers/users/webauthn_setup_controller_spec.rb
+++ b/spec/controllers/users/webauthn_setup_controller_spec.rb
@@ -91,7 +91,7 @@
delete :delete, params: { id: webauthn_configuration.id }
- expect(response).to redirect_to(account_url)
+ expect(response).to redirect_to(account_two_factor_authentication_path)
expect(flash.now[:success]).to eq t('notices.webauthn_deleted')
expect(WebauthnConfiguration.count).to eq(0)
end
diff --git a/spec/features/account/backup_codes_spec.rb b/spec/features/account/backup_codes_spec.rb
index 3eeeb1c212e..06741bdf02f 100644
--- a/spec/features/account/backup_codes_spec.rb
+++ b/spec/features/account/backup_codes_spec.rb
@@ -3,6 +3,7 @@
feature 'Backup codes' do
before do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
end
context 'with backup codes' do
@@ -19,7 +20,7 @@
click_continue
expect(page).to have_content(t('notices.backup_codes_configured'))
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
end
it 'allows you to delete the backup codes' do
@@ -31,7 +32,7 @@
click_button t('account.index.backup_code_confirm_delete')
expect(page).to have_content(t('notices.backup_codes_deleted'))
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
end
end
@@ -58,13 +59,14 @@
in_time_zone('UTC')
formatted_generated_at = l(generated_at, format: t('time.formats.event_timestamp'))
- expected_message = "#{t('account.index.backup_codes_exist')}\n#{formatted_generated_at}"
+ expected_message = "#{t('account.index.backup_codes_exist')} #{formatted_generated_at}"
expect(page).to have_current_path(backup_code_setup_path)
click_continue
expect(page).to have_content(t('notices.backup_codes_configured'))
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
+
expect(page).to have_content(expected_message)
end
end
@@ -73,7 +75,7 @@
let(:user) { create(:user, :with_backup_code) }
it 'the user is not prompted to set up another MFA upon login' do
- expect(current_url).to eq account_url
+ expect(current_path).to eq account_two_factor_authentication_path
end
end
end
diff --git a/spec/features/account/device_spec.rb b/spec/features/account/device_spec.rb
index 5b722fbacf2..abe91408cfc 100644
--- a/spec/features/account/device_spec.rb
+++ b/spec/features/account/device_spec.rb
@@ -12,7 +12,7 @@
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
last_used_at: Time.zone.now,
last_ip: '127.0.0.1')
- visit account_path
+ visit account_history_path
end
scenario 'viewing devices' do
diff --git a/spec/features/account_connected_apps_spec.rb b/spec/features/account_connected_apps_spec.rb
index ecdaee76540..a7d027516a6 100644
--- a/spec/features/account_connected_apps_spec.rb
+++ b/spec/features/account_connected_apps_spec.rb
@@ -26,12 +26,13 @@
before do
sign_in_and_2fa_user(user)
build_account_connected_apps
- visit account_path
+ visit account_connected_accounts_path
end
scenario 'viewing account connected applications' do
- expect(page).to have_content(t('headings.account.connected_apps'))
+ expect(page).to have_content(t('headings.account.connected_accounts'))
+ visit account_history_path
expect(page).to have_content( \
t('event_types.authenticated_at', service_provider: identity_without_link.display_name),
)
@@ -47,17 +48,20 @@
identity_with_link.display_name, href: 'http://localhost:3000'
)
+ visit account_connected_accounts_path
expect(identity_without_link_timestamp).to appear_before(identity_with_link_timestamp)
end
scenario 'revoking consent from an SP' do
identity_to_revoke = identity_with_link
+ visit account_history_path
expect(page).to have_content(
t('event_types.authenticated_at', service_provider: identity_to_revoke.display_name),
)
- within(find('.profile-info-box', text: t('headings.account.connected_apps'))) do
+ visit account_connected_accounts_path
+ within(find('.profile-info-box')) do
within(find('.mxn1', text: identity_to_revoke.sp.friendly_name)) do
click_link(t('account.revoke_consent.link_title'))
end
@@ -67,7 +71,7 @@
click_on t('forms.buttons.continue')
# Accounts page should no longer list this app in the applications section
- within(find('.profile-info-box', text: t('headings.account.connected_apps'))) do
+ within(find('.profile-info-box')) do
expect(has_selector?('.mxn1', text: identity_to_revoke.sp.friendly_name)).to eq(false)
end
end
diff --git a/spec/features/account_history_spec.rb b/spec/features/account_history_spec.rb
index b73bdbe5069..a6804abbf65 100644
--- a/spec/features/account_history_spec.rb
+++ b/spec/features/account_history_spec.rb
@@ -44,7 +44,7 @@
before do
sign_in_and_2fa_user(user)
build_account_history
- visit account_path
+ visit account_history_path
end
scenario 'viewing account history' do
diff --git a/spec/features/device_tracking_spec.rb b/spec/features/device_tracking_spec.rb
index 879033678da..145f3d5358e 100644
--- a/spec/features/device_tracking_spec.rb
+++ b/spec/features/device_tracking_spec.rb
@@ -12,7 +12,7 @@
context 'with account history' do
it 'has account created events' do
- visit account_path
+ visit account_history_path
expect(page).to have_content(t('event_types.account_created'))
click_link t('headings.account.events')
diff --git a/spec/features/phone/default_phone_selection_spec.rb b/spec/features/phone/default_phone_selection_spec.rb
index 9a424f95c50..fbd24199f6f 100644
--- a/spec/features/phone/default_phone_selection_spec.rb
+++ b/spec/features/phone/default_phone_selection_spec.rb
@@ -67,7 +67,7 @@
expect(page).to have_current_path(account_path)
- node = page.first('.account-list-item', text: new_phone)
+ node = page.first('.grid-row > .grid-col-5', text: new_phone)
expect(node).to have_content '202-555-3111'
parent = node.first(:xpath, './/..')
expect(parent).to have_content t('account.index.default')
diff --git a/spec/features/phone/remove_phone_spec.rb b/spec/features/phone/remove_phone_spec.rb
index fc1fb7599ce..a75681b5afa 100644
--- a/spec/features/phone/remove_phone_spec.rb
+++ b/spec/features/phone/remove_phone_spec.rb
@@ -11,8 +11,10 @@
click_button t('forms.phone.buttons.delete')
- expect(page).to have_content t('event_types.phone_removed')
expect(page).to have_current_path(account_path)
+
+ visit account_history_path
+ expect(page).to have_content t('event_types.phone_removed')
expect(PhoneConfiguration.find_by(id: phone_configuration.id)).to eq(nil)
expect(MfaPolicy.new(user.reload).multiple_factors_enabled?).to eq false
end
diff --git a/spec/features/remember_device/revocation_spec.rb b/spec/features/remember_device/revocation_spec.rb
index e2887e1b11f..09ea559e60e 100644
--- a/spec/features/remember_device/revocation_spec.rb
+++ b/spec/features/remember_device/revocation_spec.rb
@@ -1,6 +1,8 @@
require 'rails_helper'
feature 'taking an action that revokes remember device' do
+ include NavigationHelper
+
before do
allow(Figaro.env).to receive(:otp_delivery_blocklist_maxretry).and_return('1000')
end
@@ -32,6 +34,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
+ visit account_two_factor_authentication_path
click_on t('account.index.webauthn_delete')
click_on t('account.index.webauthn_confirm_delete')
first(:link, t('links.sign_out')).click
@@ -47,6 +50,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
+ visit account_two_factor_authentication_path
page.find('.remove-piv').click
click_on t('account.index.piv_cac_confirm_delete')
first(:link, t('links.sign_out')).click
@@ -62,6 +66,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
+ visit account_two_factor_authentication_path
page.find('.remove-auth-app').click # Delete
click_on t('account.index.totp_confirm_delete')
first(:link, t('links.sign_out')).click
@@ -77,6 +82,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
+ visit account_two_factor_authentication_path
click_on t('forms.backup_code.regenerate')
click_on t('account.index.backup_code_confirm_regenerate')
expect(page).to have_content(t('forms.backup_code.subtitle'))
@@ -91,6 +97,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
+ visit account_two_factor_authentication_path
click_on t('forms.backup_code.generate')
click_continue
click_continue
@@ -118,7 +125,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
- click_on(t('account.forget_all_browsers.link_title'))
+ find_sidenav_forget_browsers_link.click
click_on(t('forms.buttons.confirm'))
first(:link, t('links.sign_out')).click
@@ -135,7 +142,7 @@
sign_in_with_remember_device_and_sign_out
sign_in_user(user)
- click_on(t('account.forget_all_browsers.link_title'))
+ find_sidenav_forget_browsers_link.click
click_on(t('forms.buttons.confirm'))
first(:link, t('links.sign_out')).click
diff --git a/spec/features/remember_device/totp_spec.rb b/spec/features/remember_device/totp_spec.rb
index 569263f8cab..2244b395984 100644
--- a/spec/features/remember_device/totp_spec.rb
+++ b/spec/features/remember_device/totp_spec.rb
@@ -44,6 +44,7 @@ def remember_device_and_sign_out_user
def remember_device_and_sign_out_user
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
page.find('.remove-auth-app').click # Delete
click_on t('account.index.totp_confirm_delete')
Timecop.travel 5.seconds.from_now # Travel past the revoked at date from disabling the device
@@ -51,7 +52,7 @@ def remember_device_and_sign_out_user
fill_in :code, with: totp_secret_from_page
check :remember_device
click_submit_default
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
first(:link, t('links.sign_out')).click
user
end
diff --git a/spec/features/remember_device/webauthn_spec.rb b/spec/features/remember_device/webauthn_spec.rb
index d986388f041..987616cce60 100644
--- a/spec/features/remember_device/webauthn_spec.rb
+++ b/spec/features/remember_device/webauthn_spec.rb
@@ -56,11 +56,12 @@ def remember_device_and_sign_out_user
def remember_device_and_sign_out_user
mock_webauthn_setup_challenge
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_link t('account.index.webauthn_add'), href: webauthn_setup_path
fill_in_nickname_and_click_continue
check :remember_device
mock_press_button_on_hardware_key_on_setup
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
first(:link, t('links.sign_out')).click
user
end
diff --git a/spec/features/users/piv_cac_management_spec.rb b/spec/features/users/piv_cac_management_spec.rb
index 05107729474..5495d825658 100644
--- a/spec/features/users/piv_cac_management_spec.rb
+++ b/spec/features/users/piv_cac_management_spec.rb
@@ -18,7 +18,7 @@ def find_form(page, attributes)
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: setup_piv_cac_url
expect(page.response_headers['Content-Security-Policy']).
@@ -32,6 +32,7 @@ def find_form(page, attributes)
subject: 'SomeIgnoredSubject')
expect(current_path).to eq account_path
+ visit account_two_factor_authentication_path
expect(page.find('.remove-piv')).to_not be_nil
user.reload
@@ -45,23 +46,24 @@ def find_form(page, attributes)
::PivCacConfiguration.create!(user_id: user_id, x509_dn_uuid: 'foo', name: 'key1')
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
expect(page).to have_link(t('forms.buttons.enable'), href: setup_piv_cac_url)
- visit account_path
+ visit account_two_factor_authentication_path
::PivCacConfiguration.create!(user_id: user_id, x509_dn_uuid: 'bar', name: 'key2')
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to_not have_link(t('forms.buttons.enable'), href: setup_piv_cac_url)
visit setup_piv_cac_path
- expect(current_path).to eq account_path
+ expect(current_path).to eq account_two_factor_authentication_path
end
scenario 'disallows association of a piv/cac with the same name' do
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: setup_piv_cac_url
nonce = piv_cac_nonce_from_form_action
@@ -73,6 +75,7 @@ def find_form(page, attributes)
expect(current_path).to eq account_path
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: setup_piv_cac_url
user.reload
fill_in 'name', with: user.piv_cac_configurations.first.name
@@ -85,7 +88,7 @@ def find_form(page, attributes)
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: setup_piv_cac_url
nonce = piv_cac_nonce_from_form_action
@@ -101,7 +104,7 @@ def find_form(page, attributes)
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: setup_piv_cac_url
nonce = piv_cac_nonce_from_form_action
@@ -132,7 +135,7 @@ def find_form(page, attributes)
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to have_link(t('forms.buttons.enable'), href: setup_piv_cac_url)
end
@@ -140,7 +143,7 @@ def find_form(page, attributes)
stub_piv_cac_service
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page.find('.remove-piv')).to_not be_nil
page.find('.remove-piv').click
@@ -148,7 +151,7 @@ def find_form(page, attributes)
expect(current_path).to eq piv_cac_delete_path
click_on t('account.index.piv_cac_confirm_delete')
- expect(current_path).to eq account_path
+ expect(current_path).to eq account_two_factor_authentication_path
expect(page).to have_link(t('forms.buttons.enable'), href: setup_piv_cac_url)
diff --git a/spec/features/users/regenerate_personal_key_spec.rb b/spec/features/users/regenerate_personal_key_spec.rb
index f60b6cd8b40..70745510db2 100644
--- a/spec/features/users/regenerate_personal_key_spec.rb
+++ b/spec/features/users/regenerate_personal_key_spec.rb
@@ -22,6 +22,7 @@
expect(Telephony).to receive(:send_personal_key_regeneration_notice).
with(to: user.phone_configurations.first.phone)
+ visit account_two_factor_authentication_path
click_button t('account.links.regenerate_personal_key')
expect(user.reload.encrypted_recovery_code_digest).to_not eq old_digest
@@ -38,6 +39,7 @@
first(:link, t('forms.buttons.edit')).click
click_on(t('links.cancel'))
+ visit account_two_factor_authentication_path
click_on(t('account.links.regenerate_personal_key'))
expect(user.reload.encrypted_recovery_code_digest).to_not eq old_digest
@@ -47,6 +49,7 @@
context 'personal key actions and information' do
before do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_button t('account.links.regenerate_personal_key')
end
@@ -73,6 +76,7 @@
it 'prompts the user to enter their personal key to confirm they have it' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_button t('account.links.regenerate_personal_key')
click_acknowledge_personal_key
@@ -99,6 +103,7 @@
it 'confirms personal key on mobile', driver: :headless_chrome_mobile do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_button t('account.links.regenerate_personal_key')
click_acknowledge_personal_key
diff --git a/spec/features/users/totp_management_spec.rb b/spec/features/users/totp_management_spec.rb
index 7c259704247..2f3c4dbb3a7 100644
--- a/spec/features/users/totp_management_spec.rb
+++ b/spec/features/users/totp_management_spec.rb
@@ -6,6 +6,7 @@
it 'allows the user to disable their totp app' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
expect(page).to have_content(t('two_factor_authentication.devices.auth_app'))
expect(page.find('.remove-auth-app')).to_not be_nil
@@ -14,7 +15,7 @@
expect(current_path).to eq auth_app_delete_path
click_on t('account.index.totp_confirm_delete')
- expect(current_path).to eq account_path
+ expect(current_path).to eq account_two_factor_authentication_path
end
end
@@ -23,6 +24,7 @@
it 'does not show the user the option to disable their totp app' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
expect(page).to have_content(t('two_factor_authentication.devices.auth_app'))
form = find_form(page, action: disable_totp_url)
@@ -35,6 +37,7 @@
it 'allows the user to setup a totp app' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: authenticator_setup_url
@@ -48,6 +51,7 @@
it 'prevents association of an auth app with the same name' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: authenticator_setup_url
@@ -69,6 +73,7 @@
it 'allows 2 auth apps and removes the add link' do
sign_in_and_2fa_user(user)
+ visit account_two_factor_authentication_path
click_link t('forms.buttons.enable'), href: authenticator_setup_url
@@ -86,7 +91,7 @@
fill_in 'code', with: generate_totp_code(secret)
click_button 'Submit'
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
expect(user.auth_app_configurations.count).to eq(2)
expect(page).to_not have_link(t('forms.buttons.enable'), href: authenticator_setup_url)
end
diff --git a/spec/features/users/user_profile_spec.rb b/spec/features/users/user_profile_spec.rb
index 4e2a5ab9505..8080392ab8a 100644
--- a/spec/features/users/user_profile_spec.rb
+++ b/spec/features/users/user_profile_spec.rb
@@ -2,6 +2,7 @@
feature 'User profile' do
include IdvStepHelper
+ include NavigationHelper
include PersonalKeyHelper
include PushNotificationsHelper
@@ -27,7 +28,7 @@
user.agency_identities << AgencyIdentity.create(user_id: user.id, agency_id: 1, uuid: '1234')
visit account_path
- click_link(t('account.links.delete_account'), href: account_delete_path)
+ find_sidenav_delete_account_link.click
expect(User.count).to eq 1
expect(AgencyIdentity.count).to eq 1
@@ -48,7 +49,7 @@
visit account_path
- click_link(t('account.links.delete_account'), href: account_delete_path)
+ find_sidenav_delete_account_link.click
request = stub_push_notification_request(
sp_push_notification_endpoint: push_notification_url,
@@ -74,7 +75,7 @@
sign_in_live_with_2fa(profile.user)
visit account_path
- click_link(t('account.links.delete_account'), href: account_delete_path)
+ find_sidenav_delete_account_link.click
expect(User.count).to eq 1
expect(Profile.count).to eq 1
@@ -93,7 +94,7 @@
expect(User.count).to eq 1
sign_in_live_with_2fa(profile.user)
visit account_path
- click_link(t('account.links.delete_account'), href: account_delete_path)
+ find_sidenav_delete_account_link.click
fill_in(t('idv.form.password'), with: profile.user.password)
click_button t('users.delete.actions.delete')
diff --git a/spec/features/webauthn/management_spec.rb b/spec/features/webauthn/management_spec.rb
index b5f57a1940b..044260498e8 100644
--- a/spec/features/webauthn/management_spec.rb
+++ b/spec/features/webauthn/management_spec.rb
@@ -10,18 +10,18 @@
def visit_webauthn_setup
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
click_link t('account.index.webauthn_add'), href: webauthn_setup_path
end
def expect_webauthn_setup_success
expect(page).to have_content(t('notices.webauthn_configured'))
- expect(page).to have_current_path(account_path)
+ expect(page).to have_current_path(account_two_factor_authentication_path)
end
def expect_webauthn_setup_error
expect(page).to have_content t('errors.webauthn_setup.general_error')
- expect(current_path).to eq account_path
+ expect(current_path).to eq account_two_factor_authentication_path
end
context 'with webauthn associations' do
@@ -30,7 +30,7 @@ def expect_webauthn_setup_error
webauthn_config2 = create(:webauthn_configuration, user: user)
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to have_content webauthn_config1.name
expect(page).to have_content webauthn_config2.name
@@ -56,7 +56,7 @@ def expect_webauthn_setup_error
webauthn_config = create(:webauthn_configuration, user: user)
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to have_content webauthn_config.name
@@ -75,7 +75,7 @@ def expect_webauthn_setup_error
webauthn_config = create(:webauthn_configuration, user: user)
sign_in_and_2fa_user(user)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to have_content webauthn_config.name
@@ -95,8 +95,8 @@ def expect_webauthn_setup_error
PhoneConfiguration.first.update(mfa_enabled: false)
user.backup_code_configurations.destroy_all
- visit account_path
- expect(current_path).to eq account_path
+ visit account_two_factor_authentication_path
+ expect(current_path).to eq account_two_factor_authentication_path
expect(page).to have_content webauthn_config.name
expect(page).to_not have_link t('account.index.webauthn_delete')
@@ -108,8 +108,8 @@ def expect_webauthn_setup_error
mock_webauthn_setup_challenge
sign_in_and_2fa_user(user)
- visit account_path
- expect(current_path).to eq account_path
+ visit account_two_factor_authentication_path
+ expect(current_path).to eq account_two_factor_authentication_path
click_link t('account.index.webauthn_add'), href: webauthn_setup_path
expect(current_path).to eq webauthn_setup_path
diff --git a/spec/support/features/navigation_helper.rb b/spec/support/features/navigation_helper.rb
new file mode 100644
index 00000000000..f56528c777c
--- /dev/null
+++ b/spec/support/features/navigation_helper.rb
@@ -0,0 +1,14 @@
+module NavigationHelper
+ # rack_test doesn't support breakpoints for styling, and we hide/show different
+ # navigation items based on those. To avoid failing because Capybara finds multiple
+ # delete links or having to enable JS on a bunch of tests, this is a helper to find the
+ # sidenav links.
+
+ def find_sidenav_delete_account_link
+ find('.sidenav').find_link(t('account.links.delete_account'), href: account_delete_path)
+ end
+
+ def find_sidenav_forget_browsers_link
+ find('.sidenav').find_link(t('account.navigation.forget_browsers'))
+ end
+end
diff --git a/spec/support/shared_examples/remember_device.rb b/spec/support/shared_examples/remember_device.rb
index 2cc3456af0f..15399fba51e 100644
--- a/spec/support/shared_examples/remember_device.rb
+++ b/spec/support/shared_examples/remember_device.rb
@@ -79,7 +79,7 @@ def expect_mfa_to_be_required_for_user(user)
end
expect(page).to have_current_path(expected_path)
- visit account_path
+ visit account_two_factor_authentication_path
expect(page).to have_current_path(expected_path)
end
end
diff --git a/spec/view_models/account_show_spec.rb b/spec/view_models/account_show_spec.rb
index 79263af9a40..4244dcbc9e8 100644
--- a/spec/view_models/account_show_spec.rb
+++ b/spec/view_models/account_show_spec.rb
@@ -1,84 +1,6 @@
require 'rails_helper'
describe AccountShow do
- describe '#verified_partial' do
- context 'user has a verified identity' do
- it 'returns the verified header partial' do
- user = User.new
- allow(user).to receive(:identity_verified?).and_return(true)
- profile_index = AccountShow.new(decrypted_pii: {}, personal_key: '', decorated_user: user,
- locked_for_session: false)
-
- expect(profile_index.verified_account_badge_partial).to eq 'accounts/verified_account_badge'
- end
- end
-
- context 'user does not have a verified identity' do
- it 'returns the unverified header partial' do
- user = User.new
- allow(user).to receive(:identity_verified?).and_return(false)
- profile_index = AccountShow.new(decrypted_pii: {}, personal_key: '', decorated_user: user,
- locked_for_session: false)
-
- expect(profile_index.verified_account_badge_partial).to eq 'shared/null'
- end
- end
- end
-
- describe '#personal_key_partial' do
- context 'AccountShow instance has a personal_key' do
- it 'returns the personal_key partial' do
- user = User.new
- profile_index = AccountShow.new(
- decrypted_pii: {}, personal_key: 'foo', decorated_user: user.decorate,
- locked_for_session: false
- )
-
- expect(profile_index.personal_key_partial).to eq 'accounts/personal_key'
- end
- end
-
- context 'AccountShow instance does not have a personal_key' do
- it 'returns the shared/null partial' do
- user = User.new
- profile_index = AccountShow.new(
- decrypted_pii: {}, personal_key: '', decorated_user: user.decorate,
- locked_for_session: false
- )
-
- expect(profile_index.personal_key_partial).to eq 'shared/null'
- end
- end
- end
-
- describe '#password_reset_partial' do
- context 'user has a password_reset_profile' do
- it 'returns the accounts/password_reset partial' do
- user = User.new.decorate
- allow(user).to receive(:password_reset_profile).and_return('profile')
- profile_index = AccountShow.new(
- decrypted_pii: {}, personal_key: 'foo', decorated_user: user,
- locked_for_session: false
- )
-
- expect(profile_index.password_reset_partial).to eq 'accounts/password_reset'
- end
- end
-
- context 'user does not have a password_reset_profile' do
- it 'returns the shared/null partial' do
- user = User.new
- allow(user).to receive(:password_reset_profile).and_return(nil)
- profile_index = AccountShow.new(
- decrypted_pii: {}, personal_key: '', decorated_user: user.decorate,
- locked_for_session: false
- )
-
- expect(profile_index.password_reset_partial).to eq 'shared/null'
- end
- end
- end
-
describe '#pending_profile_partial' do
context 'user needs profile usps verification' do
it 'returns the accounts/pending_profile_usps partial' do
@@ -105,36 +27,6 @@
end
end
- describe '#pii_partial' do
- context 'AccountShow instance has decrypted_pii' do
- context 'session is not expired' do
- it 'returns the accounts/password_reset partial' do
- user = User.new.decorate
- birthday = Date.new(2000, 7, 27)
- profile_index = AccountShow.new(
- decrypted_pii: Pii::Attributes.new_from_hash(foo: 'bar', first_name: 'foo',
- last_name: 'bar',
- dob: birthday),
- personal_key: '', decorated_user: user,
- locked_for_session: false
- )
-
- expect(profile_index.pii_partial).to eq 'accounts/pii'
- end
- end
- end
-
- context 'AccountShow instance does not have decrypted_pii' do
- it 'returns the shared/null partial' do
- user = User.new.decorate
- profile_index = AccountShow.new(decrypted_pii: {}, personal_key: '', decorated_user: user,
- locked_for_session: false)
-
- expect(profile_index.pii_partial).to eq 'shared/null'
- end
- end
- end
-
describe '#totp_partial' do
context 'user has enabled an authenticator app' do
it 'returns the disable_totp partial' do
diff --git a/spec/views/accounts/_nav_auth.html.erb_spec.rb b/spec/views/accounts/_nav_auth.html.erb_spec.rb
index a93b945986f..5a9b44adbd7 100644
--- a/spec/views/accounts/_nav_auth.html.erb_spec.rb
+++ b/spec/views/accounts/_nav_auth.html.erb_spec.rb
@@ -1,12 +1,14 @@
require 'rails_helper'
describe 'accounts/_nav_auth.html.erb' do
+ before do
+ @user = build_stubbed(:user, :signed_up)
+ allow(view).to receive(:greeting).and_return(@user.email)
+ end
+
context 'user is signed in' do
before do
- @user = build_stubbed(:user, :signed_up)
- allow(view).to receive(:current_user).and_return(@user)
- allow(view).to receive(:greeting).and_return(@user.email)
- render
+ render partial: 'accounts/nav_auth.html.erb', locals: { enable_mobile_nav: false }
end
it 'contains welcome message' do
@@ -21,4 +23,14 @@
expect(rendered).to have_link(t('links.sign_out'), href: destroy_user_session_path)
end
end
+
+ context 'mobile nav is enabled' do
+ before do
+ render partial: 'accounts/nav_auth.html.erb', locals: { enable_mobile_nav: true }
+ end
+
+ it 'contains menu button' do
+ expect(rendered).to have_button t('account.navigation.menu')
+ end
+ end
end
diff --git a/spec/views/accounts/connected_accounts/show.html.erb_spec.rb b/spec/views/accounts/connected_accounts/show.html.erb_spec.rb
new file mode 100644
index 00000000000..f041f1992da
--- /dev/null
+++ b/spec/views/accounts/connected_accounts/show.html.erb_spec.rb
@@ -0,0 +1,31 @@
+require 'rails_helper'
+describe 'accounts/connected_accounts/show.html.erb' do
+ let(:user) { create(:user, :signed_up, :with_personal_key) }
+ let(:decorated_user) { user.decorate }
+
+ before do
+ allow(user).to receive(:decorate).and_return(decorated_user)
+ allow(view).to receive(:current_user).and_return(user)
+ assign(
+ :view_model,
+ AccountShow.new(decrypted_pii: nil, personal_key: nil, decorated_user: decorated_user,
+ locked_for_session: false),
+ )
+ end
+
+ it 'contains connected applications' do
+ render
+
+ expect(rendered).to have_content t('headings.account.connected_accounts')
+ end
+
+ context 'with a connected app that is a NullServiceProvider' do
+ before do
+ user.identities << create(:identity, :active, service_provider: 'aaaaa')
+ end
+
+ it 'renders' do
+ expect { render }.to_not raise_error
+ end
+ end
+end
diff --git a/spec/views/accounts/history/show.html.erb_spec.rb b/spec/views/accounts/history/show.html.erb_spec.rb
new file mode 100644
index 00000000000..66aed725cbb
--- /dev/null
+++ b/spec/views/accounts/history/show.html.erb_spec.rb
@@ -0,0 +1,23 @@
+require 'rails_helper'
+
+describe 'accounts/history/show.html.erb' do
+ let(:user) { create(:user, :signed_up, :with_personal_key) }
+ let(:decorated_user) { user.decorate }
+
+ before do
+ allow(user).to receive(:decorate).and_return(decorated_user)
+ allow(view).to receive(:current_user).and_return(user)
+ assign(
+ :view_model,
+ AccountShow.new(decrypted_pii: nil, personal_key: nil, decorated_user: decorated_user,
+ locked_for_session: false),
+ )
+ end
+
+ it 'contains account history' do
+ render
+
+ expect(rendered).to have_content t('account.navigation.history')
+ expect(rendered).to have_content t('headings.account.activity')
+ end
+end
diff --git a/spec/views/accounts/show.html.erb_spec.rb b/spec/views/accounts/show.html.erb_spec.rb
index 37bff5f44be..a75d27dc090 100644
--- a/spec/views/accounts/show.html.erb_spec.rb
+++ b/spec/views/accounts/show.html.erb_spec.rb
@@ -14,61 +14,10 @@
)
end
- context 'user is not TOTP enabled' do
- it 'has a localized title' do
- expect(view).to receive(:title).with(t('titles.account'))
+ it 'has a localized title' do
+ expect(view).to receive(:title).with(t('titles.account'))
- render
- end
-
- it 'contains link to enable TOTP' do
- render
-
- expect(rendered).to have_link(t('forms.buttons.enable'), href: authenticator_setup_url)
- expect(rendered).not_to have_xpath("//input[@value='Disable']")
- end
-
- it 'contains link to delete account' do
- render
-
- expect(rendered).to have_content t('account.items.delete_your_account', app: APP_NAME)
- expect(rendered).
- to have_link(t('account.links.delete_account'), href: account_delete_path)
- end
- end
-
- context 'when user is TOTP enabled' do
- let(:user) { create(:user, :signed_up, :with_authentication_app) }
-
- before do
- assign(
- :view_model,
- AccountShow.new(decrypted_pii: nil, personal_key: nil, decorated_user: decorated_user,
- locked_for_session: false),
- )
- end
-
- it 'contains link to disable TOTP' do
- render
-
- expect(rendered).to have_link(t('forms.buttons.disable', href: auth_app_delete_path))
- expect(rendered).not_to have_link(t('forms.buttons.enable'), href: authenticator_start_path)
- end
- end
-
- context 'when the user does not have password_reset_profile' do
- before do
- allow(decorated_user).to receive(:password_reset_profile).and_return(false)
- end
-
- it 'contains a personal key section' do
- render
-
- expect(rendered).to have_content t('account.items.personal_key')
- expect(rendered).
- to have_button t('account.links.regenerate_personal_key')
- expect(rendered).to have_xpath("//form[@action='#{create_new_personal_key_url}']")
- end
+ render
end
context 'when current user has password_reset_profile' do
@@ -76,15 +25,6 @@
allow(decorated_user).to receive(:password_reset_profile).and_return(true)
end
- it 'lacks a personal key section' do
- render
-
- expect(rendered).to_not have_content t('account.items.personal_key')
- expect(rendered).to_not have_link(
- t('account.links.regenerate_personal_key'), href: manage_personal_key_path
- )
- end
-
it 'displays an alert with instructions to reactivate their profile' do
render
@@ -126,62 +66,6 @@
end
end
- it 'contains account history' do
- render
-
- expect(rendered).to have_content t('headings.account.account_history')
- end
-
- context 'events' do
- let!(:event_without_ip) do
- create(:event, event_type: :password_invalidated,
- user: user,
- ip: nil)
- end
-
- it 'contains user events that may not contain IP addresses' do
- render
-
- page = Capybara.string(rendered)
- events_section = page.find(
- ".profile-info-box:contains('#{t('headings.account.account_history')}')",
- )
-
- expect(events_section).to have_content(event_without_ip.decorate.event_type)
- expect(events_section).to_not have_content('IP address potentially located in')
- end
- end
-
- context 'connected apps' do
- it 'contains connected applications' do
- render
-
- expect(rendered).to have_content t('headings.account.connected_apps')
- end
-
- context 'with a connected app that is a NullServiceProvider' do
- before do
- user.identities << create(:identity, :active, service_provider: 'aaaaa')
- end
-
- it 'renders' do
- expect { render }.to_not raise_error
- end
- end
- end
-
- it 'shows the auth nav bar' do
- render
-
- expect(view).to render_template(partial: '_nav_auth')
- end
-
- it 'shows the delete account bar' do
- render
-
- expect(view).to render_template(partial: '_delete_account_item_heading')
- end
-
context 'phone listing and adding' do
it 'renders the phone section' do
render
diff --git a/spec/views/accounts/two_factor_authentication/show.html.erb_spec.rb b/spec/views/accounts/two_factor_authentication/show.html.erb_spec.rb
new file mode 100644
index 00000000000..7ad73de5a7b
--- /dev/null
+++ b/spec/views/accounts/two_factor_authentication/show.html.erb_spec.rb
@@ -0,0 +1,74 @@
+require 'rails_helper'
+
+describe 'accounts/two_factor_authentication/show.html.erb' do
+ let(:user) { create(:user, :signed_up, :with_personal_key) }
+ let(:decorated_user) { user.decorate }
+
+ before do
+ allow(user).to receive(:decorate).and_return(decorated_user)
+ allow(view).to receive(:current_user).and_return(user)
+ assign(
+ :view_model,
+ AccountShow.new(decrypted_pii: nil, personal_key: nil, decorated_user: decorated_user,
+ locked_for_session: false),
+ )
+ end
+
+ context 'user is not TOTP enabled' do
+ it 'contains link to enable TOTP' do
+ render
+
+ expect(rendered).to have_link(t('forms.buttons.enable'), href: authenticator_setup_url)
+ expect(rendered).not_to have_xpath("//input[@value='Disable']")
+ end
+ end
+
+ context 'when user is TOTP enabled' do
+ let(:user) { create(:user, :signed_up, :with_authentication_app) }
+
+ before do
+ assign(
+ :view_model,
+ AccountShow.new(decrypted_pii: nil, personal_key: nil, decorated_user: decorated_user,
+ locked_for_session: false),
+ )
+ end
+
+ it 'contains link to disable TOTP' do
+ render
+
+ expect(rendered).to have_link(t('forms.buttons.disable', href: auth_app_delete_path))
+ expect(rendered).not_to have_link(t('forms.buttons.enable'), href: authenticator_start_path)
+ end
+ end
+
+ context 'when the user does not have password_reset_profile' do
+ before do
+ allow(decorated_user).to receive(:password_reset_profile).and_return(false)
+ end
+
+ it 'contains a personal key section' do
+ render
+
+ expect(rendered).to have_content t('account.items.personal_key')
+ expect(rendered).
+ to have_button t('account.links.regenerate_personal_key')
+ expect(rendered).to have_xpath("//form[@action='#{create_new_personal_key_url}']")
+ end
+ end
+
+ context 'when current user has password_reset_profile' do
+ before do
+ allow(decorated_user).to receive(:password_reset_profile).and_return(true)
+ end
+
+ it 'lacks a personal key section' do
+ render
+
+ expect(rendered).to_not have_content t('account.items.personal_key')
+ expect(rendered).to_not have_link(
+ t('account.links.regenerate_personal_key'), href: manage_personal_key_path
+ )
+ end
+ end
+end