|
|
@ -146,19 +146,19 @@ describe Devise::Models::TwoFactorAuthenticatable, '#max_login_attempts' do |
|
|
|
|
|
|
|
|
|
|
|
it "returns false as boolean" do |
|
|
|
it "returns false as boolean" do |
|
|
|
instance.second_factor_attempts_count = nil |
|
|
|
instance.second_factor_attempts_count = nil |
|
|
|
expect(instance.max_login_attempts?).to be_false |
|
|
|
expect(instance.max_login_attempts?).to be_falsey |
|
|
|
instance.second_factor_attempts_count = 0 |
|
|
|
instance.second_factor_attempts_count = 0 |
|
|
|
expect(instance.max_login_attempts?).to be_false |
|
|
|
expect(instance.max_login_attempts?).to be_falsey |
|
|
|
instance.second_factor_attempts_count = 1 |
|
|
|
instance.second_factor_attempts_count = 1 |
|
|
|
expect(instance.max_login_attempts?).to be_false |
|
|
|
expect(instance.max_login_attempts?).to be_falsey |
|
|
|
instance.second_factor_attempts_count = 2 |
|
|
|
instance.second_factor_attempts_count = 2 |
|
|
|
expect(instance.max_login_attempts?).to be_false |
|
|
|
expect(instance.max_login_attempts?).to be_falsey |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "returns true as boolean after too many attempts" do |
|
|
|
it "returns true as boolean after too many attempts" do |
|
|
|
instance.second_factor_attempts_count = 3 |
|
|
|
instance.second_factor_attempts_count = 3 |
|
|
|
expect(instance.max_login_attempts?).to be_true |
|
|
|
expect(instance.max_login_attempts?).to be_truthy |
|
|
|
instance.second_factor_attempts_count = 4 |
|
|
|
instance.second_factor_attempts_count = 4 |
|
|
|
expect(instance.max_login_attempts?).to be_true |
|
|
|
expect(instance.max_login_attempts?).to be_truthy |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|