mirror of
https://github.com/astaxie/beego.git
synced 2025-07-13 14:11:02 +00:00
Merge pull request #2365 from chesedo/RequiredValidationCatchSpaces
[WIP]Have Required validator trim strings to fix #2361
This commit is contained in:
@ -35,6 +35,12 @@ func TestRequired(t *testing.T) {
|
||||
if valid.Required("", "string").Ok {
|
||||
t.Error("\"'\" string should be false")
|
||||
}
|
||||
if valid.Required(" ", "string").Ok {
|
||||
t.Error("\" \" string should be false") // For #2361
|
||||
}
|
||||
if valid.Required("\n", "string").Ok {
|
||||
t.Error("new line string should be false") // For #2361
|
||||
}
|
||||
if !valid.Required("astaxie", "string").Ok {
|
||||
t.Error("string should be true")
|
||||
}
|
||||
|
Reference in New Issue
Block a user