From aa10e8f399d94c1efe9fd0665484f1fda5d484d4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Feb 2025 03:14:35 -0500 Subject: [PATCH] Verify page content in 2FA portion of `auth/sessions` controller spec (#33891) --- .../auth/sessions_controller_spec.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/controllers/auth/sessions_controller_spec.rb b/spec/controllers/auth/sessions_controller_spec.rb index 4a6956cb0..c852b16a6 100644 --- a/spec/controllers/auth/sessions_controller_spec.rb +++ b/spec/controllers/auth/sessions_controller_spec.rb @@ -223,8 +223,8 @@ RSpec.describe Auth::SessionsController do end it 'renders two factor authentication page' do - expect(controller).to render_template('two_factor') - expect(controller).to render_template(partial: '_otp_authentication_form') + expect(response.body) + .to include(I18n.t('simple_form.hints.sessions.otp')) end end @@ -239,8 +239,8 @@ RSpec.describe Auth::SessionsController do end it 'renders two factor authentication page' do - expect(controller).to render_template('two_factor') - expect(controller).to render_template(partial: '_otp_authentication_form') + expect(response.body) + .to include(I18n.t('simple_form.hints.sessions.otp')) end end @@ -250,8 +250,8 @@ RSpec.describe Auth::SessionsController do end it 'renders two factor authentication page' do - expect(controller).to render_template('two_factor') - expect(controller).to render_template(partial: '_otp_authentication_form') + expect(response.body) + .to include(I18n.t('simple_form.hints.sessions.otp')) end end @@ -378,8 +378,8 @@ RSpec.describe Auth::SessionsController do end it 'renders webauthn authentication page' do - expect(controller).to render_template('two_factor') - expect(controller).to render_template(partial: '_webauthn_form') + expect(response.body) + .to include(I18n.t('simple_form.title.sessions.webauthn')) end end @@ -389,8 +389,8 @@ RSpec.describe Auth::SessionsController do end it 'renders webauthn authentication page' do - expect(controller).to render_template('two_factor') - expect(controller).to render_template(partial: '_webauthn_form') + expect(response.body) + .to include(I18n.t('simple_form.title.sessions.webauthn')) end end