mirror of
https://github.com/volatiletech/authboss.git
synced 2025-03-17 21:17:57 +02:00
Fix default.Rules lowercase condition
This commit is contained in:
parent
87b06f40ed
commit
63e9512667
@ -56,7 +56,7 @@ func (r Rules) Errors(toValidate string) authboss.ErrorList {
|
||||
if upper < r.MinUpper {
|
||||
errs = append(errs, FieldError{r.FieldName, errors.New(r.upperErr())})
|
||||
}
|
||||
if upper < r.MinLower {
|
||||
if lower < r.MinLower {
|
||||
errs = append(errs, FieldError{r.FieldName, errors.New(r.lowerErr())})
|
||||
}
|
||||
if numeric < r.MinNumeric {
|
||||
|
@ -48,6 +48,11 @@ func TestRules_Errors(t *testing.T) {
|
||||
"hi",
|
||||
"email: Must be between 3 and 5 characters",
|
||||
},
|
||||
{
|
||||
Rules{FieldName: "email", MinUpper: 2, MinLower: 1},
|
||||
"AA",
|
||||
"email: Must contain at least 1 lowercase letter",
|
||||
},
|
||||
{
|
||||
Rules{FieldName: "email", MinLetters: 5},
|
||||
"13345",
|
||||
|
Loading…
x
Reference in New Issue
Block a user