diff options
Diffstat (limited to 'model/user_test.go')
-rw-r--r-- | model/user_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/model/user_test.go b/model/user_test.go index 013bacc1c..4db099f97 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -89,4 +89,21 @@ func TestUserIsValid(t *testing.T) { if err := user.IsValid(); err != nil { t.Fatal(err) } + + user.FirstName = "" + user.LastName = "" + if err := user.IsValid(); err != nil { + t.Fatal(err) + } + + user.FirstName = strings.Repeat("01234567890", 20) + if err := user.IsValid(); err == nil { + t.Fatal(err) + } + + user.FirstName = "" + user.LastName = strings.Repeat("01234567890", 20) + if err := user.IsValid(); err == nil { + t.Fatal(err) + } } |