fix tests

This commit is contained in:
root
2021-06-08 17:34:04 +00:00
parent fc589cff38
commit 38c1078eab
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ func TestCreateSessionRecord(t *testing.T) {
t.Fatalf("failed to create user")
}
userTOKEN := raw["token"].(string)
data := `{"expiration":"1m","cookie":"abcdefg"}`
data := `{"expiration":"1m","cookie":"abcdefg","login":"alex"}`
sid, _ := uuid.GenerateUUID()
raw, _ = helpCreateSession(sid, data)
if _, ok := raw["status"]; !ok || raw["status"].(string) != "ok" {
@@ -65,7 +65,7 @@ func TestCreateSessionRecord(t *testing.T) {
if raw["total"].(float64) != 1 {
t.Fatalf("wrong number of sessions")
}
data2 := `{"expiration":"1m","cookie":"abcdefg2"}`
data2 := `{"expiration":"1m","cookie":"abcdefg2","login":"alex"}`
sid2, _ := uuid.GenerateUUID()
raw, _ = helpCreateSession(sid2, data2)
if _, ok := raw["status"]; !ok || raw["status"].(string) != "ok" {

View File

@@ -146,7 +146,7 @@ func TestUserLoginDelete(t *testing.T) {
rootToken = oldRootToken
// get user requests
raw, _ = helpGetUserRequests()
if raw["total"].(float64) != 4 {
if raw["total"].(float64) != 3 {
t.Fatalf("Wrong number of user requests for admin to approve/reject/s\n")
}
records := raw["rows"].([]interface{})