diff --git a/app/views/idv/phone_errors/warning.html.erb b/app/views/idv/phone_errors/warning.html.erb index 02ac8793272..d962b925021 100644 --- a/app/views/idv/phone_errors/warning.html.erb +++ b/app/views/idv/phone_errors/warning.html.erb @@ -28,7 +28,7 @@

- <%= t('idv.failure.phone.warning.attempts', count: @remaining_attempts) %> + <%= t('idv.failure.phone.warning.attempts_html', count: @remaining_attempts) %>

diff --git a/app/views/idv/session_errors/warning.html.erb b/app/views/idv/session_errors/warning.html.erb index 950cc1e4855..5834b6c91b3 100644 --- a/app/views/idv/session_errors/warning.html.erb +++ b/app/views/idv/session_errors/warning.html.erb @@ -4,7 +4,7 @@ <% c.with_header { t('idv.warning.sessions.heading') } %>

<%= t('idv.failure.sessions.warning') %>

-

<%= t('idv.warning.attempts', count: @remaining_attempts) %>

+

<%= t('idv.warning.attempts_html', count: @remaining_attempts) %>

<% c.with_action_button( action: ->(**tag_options, &block) { link_to(@try_again_path, **tag_options, &block) }, diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 6e4099cbb4e..0d64e1e0cab 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -106,9 +106,10 @@ en: heading: 'We couldn’t verify your identity by phone' timeout: Our request to verify your information timed out. Please try again. warning: - attempts: - one: For security reasons, you have one attempt remaining. - other: For security reasons, you have %{count} attempts remaining. + attempts_html: + one: For security reasons, you have one attempt remaining. + other: For security reasons, you have %{count} attempts + remaining. gpo: button: Verify by mail explanation: If you don’t have another phone number to try, verify by mail @@ -277,9 +278,10 @@ en: technical_difficulties: Unfortunately, we are having technical difficulties and cannot verify your identity at this time. warning: - attempts: - one: For security reasons, you have one attempt remaining. - other: For security reasons, you have %{count} attempts remaining. + attempts_html: + one: For security reasons, you have one attempt remaining. + other: For security reasons, you have %{count} attempts + remaining. sessions: heading: We couldn’t find records matching your personal information state_id: diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 6a44773f345..a41780bcc1d 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -114,9 +114,9 @@ es: timeout: Nuestra solicitud para verificar tu información ha caducado. Vuelve a intentarlo. warning: - attempts: - one: Por razones de seguridad, dispone de un solo intento. - other: Por razones de seguridad, le quedan %{count} intentos. + attempts_html: + one: Por razones de seguridad, le queda un solo intento. + other: Por razones de seguridad, le quedan %{count} intentos. gpo: button: Verificar por correo explanation: Si no dispones de otro número de teléfono para intentarlo, @@ -292,9 +292,9 @@ es: technical_difficulties: Lamentablemente, debido a problemas técnicos por nuestra parte, tal vez no podamos verificar su identidad en estos momentos. warning: - attempts: - one: Por motivos de seguridad, le quedan un intento. - other: Por motivos de seguridad, le quedan %{count} intentos. + attempts_html: + one: Por motivos de seguridad, le queda un intento. + other: Por motivos de seguridad, le quedan %{count} intentos. sessions: heading: No encontramos registros que coincidan con sus datos personales state_id: diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index f0bbd4c3cb9..ceb0c4ba01e 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -119,9 +119,10 @@ fr: timeout: Notre demande de vérification de vos renseignements a expiré. Veuillez réessayer. warning: - attempts: - one: Pour des raisons de sécurité, il vous reste une tentative. - other: Pour des raisons de sécurité, il vous reste %{count} tentatives. + attempts_html: + one: Pour des raisons de sécurité, il vous reste une tentative. + other: Pour des raisons de sécurité, il vous reste %{count} + tentatives. gpo: button: Vérifier par courrier explanation: Si vous n’avez pas d’autre numéro de téléphone à essayer, vérifiez @@ -307,9 +308,10 @@ fr: technical_difficulties: Malheureusement, nous rencontrons des difficultés techniques et ne pouvons pas vérifier votre identité pour le moment. warning: - attempts: - one: Pour des raisons de sécurité, il vous reste une tentative. - other: Pour des raisons de sécurité, il vous reste %{count} tentatives. + attempts_html: + one: Pour des raisons de sécurité, il vous reste une tentative. + other: Pour des raisons de sécurité, il vous reste %{count} + tentatives. sessions: heading: Nous n’avons pas trouvé de dossiers correspondant à vos informations personnelles diff --git a/spec/features/idv/doc_auth/verify_info_step_spec.rb b/spec/features/idv/doc_auth/verify_info_step_spec.rb index 67f7748c050..76885bec26b 100644 --- a/spec/features/idv/doc_auth/verify_info_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_info_step_spec.rb @@ -159,7 +159,11 @@ # Check that last attempt shows correct warning text click_idv_continue expect(page).to have_current_path(idv_session_errors_warning_path) - expect(page).to have_content(t('idv.warning.attempts.one')) + expect(page).to have_content( + strip_tags( + t('idv.warning.attempts_html.one'), + ), + ) click_try_again click_idv_continue diff --git a/spec/views/idv/phone_errors/warning.html.erb_spec.rb b/spec/views/idv/phone_errors/warning.html.erb_spec.rb index 75dc851218e..f89daa0eb00 100644 --- a/spec/views/idv/phone_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/warning.html.erb_spec.rb @@ -49,9 +49,11 @@ it 'shows remaining attempts' do expect(rendered).to have_text( - t( - 'idv.failure.phone.warning.attempts', - count: remaining_attempts, + strip_tags( + t( + 'idv.failure.phone.warning.attempts_html', + count: remaining_attempts, + ), ), ) end diff --git a/spec/views/idv/session_errors/warning.html.erb_spec.rb b/spec/views/idv/session_errors/warning.html.erb_spec.rb index 3de391005ab..9485637d139 100644 --- a/spec/views/idv/session_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/session_errors/warning.html.erb_spec.rb @@ -22,7 +22,11 @@ end it 'shows remaining attempts' do - expect(rendered).to have_text(t('idv.warning.attempts', count: remaining_attempts)) + expect(rendered).to have_text( + strip_tags( + t('idv.warning.attempts_html', count: remaining_attempts), + ), + ) end it 'shows a cancel link' do @@ -34,7 +38,11 @@ it 'does not render troubleshooting option to retake photos' do expect(rendered).to have_link(t('idv.failure.button.warning'), href: try_again_path) - expect(rendered).to have_text(t('idv.warning.attempts', count: remaining_attempts)) + expect(rendered).to have_text( + strip_tags( + t('idv.warning.attempts_html', count: remaining_attempts), + ), + ) expect(rendered).to have_link(t('links.cancel'), href: idv_cancel_path) end end