Allow define maximum_attemps and unlock_in

This commit is contained in:
taitus
2023-10-09 09:54:42 +02:00
parent 873ec84b52
commit d54a5c2ae0
5 changed files with 89 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ describe Users::SessionsController do
describe "Devise lock" do
context "when devise sign in maximum_attempts reached", :with_frozen_time do
it "locks the user account and sends an email to the account with an unlock link" do
user.update(failed_attempts: 19)
allow(User).to receive(:maximum_attempts).and_return(1)
expect do
post :create, params: { user: { login: "citizen@consul.org", password: "wrongpassword" }}