You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
570 B

3 years ago
package main
import (
"log"
"testing"
"git.sporestack.com/SporeStack/settlers"
3 years ago
)
func TestEnable(t *testing.T) {
db, err := dbConnect(testConfiguration)
if err != nil {
return
}
defer db.Close()
depositToken := settlers.DepositToken(testToken)
userErr, err := enable(testToken, testToken, depositToken, db, testConfiguration)
3 years ago
if err != nil {
t.Error(err.Error())
} else if userErr != settlers.ErrorIncorrectAdminToken {
3 years ago
t.Error("Did not give incorrect admin token error for invalid token.")
} else {
log.Print("We secure enable properly.")
}
}