test fillNonPlayerAliases
This commit is contained in:
@@ -194,6 +194,26 @@ func TestServeGM(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("fillNonPlayerAliases", func(t *testing.T) {
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
v01 := NewV01(ctx, nil)
|
||||
v01.cfg.Users = nil
|
||||
resp := do(v01, "/gm/rpc/fillNonPlayerAliases", "[qt]")
|
||||
if resp.Code != http.StatusNoContent {
|
||||
t.Error(resp.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("not enough", func(t *testing.T) {
|
||||
v01 := NewV01(ctx, nil)
|
||||
v01.cfg.Users = map[string]configUser{
|
||||
"zach": configUser{Player: 0},
|
||||
}
|
||||
resp := do(v01, "/gm/rpc/fillNonPlayerAliases", "[]")
|
||||
if resp.Code != http.StatusBadRequest {
|
||||
t.Error(resp.Code)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("happy", func(t *testing.T) {
|
||||
v01 := NewV01(ctx, nil)
|
||||
v01.cfg.Users = map[string]configUser{
|
||||
|
||||
Reference in New Issue
Block a user