Browse Source

replaced flash :error key with :alert

master
Eugene Surzhko 9 years ago
parent
commit
5c66499bb1
  1. 2
      app/controllers/devise/two_factor_authentication_controller.rb
  2. 2
      spec/features/two_factor_authenticatable_spec.rb

2
app/controllers/devise/two_factor_authentication_controller.rb

@ -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)

2
spec/features/two_factor_authenticatable_spec.rb

@ -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
end

Loading…
Cancel
Save