summaryrefslogtreecommitdiffstats
path: root/model/user_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/user_test.go')
-rw-r--r--model/user_test.go17
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)
+ }
}