replaced flash :error key with :alert
@ -52,7 +52,7 @@ class Devise::TwoFactorAuthenticationController < DeviseController
def after_two_factor_fail_for(resource)
resource.second_factor_attempts_count += 1
resource.save
flash.now[:error] = find_message(:attempt_failed)
set_flash_message :alert, find_message(:attempt_failed), now: true
if resource.max_login_attempts?
sign_out(resource)
@ -84,7 +84,7 @@ feature "User of two factor authentication" do
fill_in "code", with: "incorrect#{rand(100)}"
click_button "Submit"
within(".flash.error") do
within(".flash.alert") do
expect(page).to have_content("Attempt failed")
end
@ -114,7 +114,7 @@ describe Devise::Models::TwoFactorAuthenticatable do
expect(uri.scheme).to eq('otpauth')
expect(uri.host).to eq('totp')
expect(uri.path).to eq('/houdini')
expect(uri.path).to eq('/Magic:houdini')
expect(params['issuer'].shift).to eq('Magic')
expect(params['secret'].shift).to match(/\w{16}/)