Add User clone test for nil Permissions

This commit is contained in:
Tyler Treat
2017-06-08 10:17:33 -05:00
parent 5d36a7797e
commit 6bdc906288

View File

@@ -66,6 +66,19 @@ func TestUserClonePermissionsNoLists(t *testing.T) {
}
}
func TestUserCloneNoPermissions(t *testing.T) {
user := &User{
Username: "foo",
Password: "bar",
}
clone := user.clone()
if clone.Permissions != nil {
t.Fatalf("Expected Permissions to be nil, got: %v", clone.Permissions)
}
}
func TestUserCloneNil(t *testing.T) {
user := (*User)(nil)
clone := user.clone()