Fixing issue with TestIssue156 due to change in registration behavior

This commit is contained in:
John Donaldson 2022-05-17 14:08:40 -07:00
parent 72d5a79798
commit 368e7306c3
1 changed files with 3 additions and 0 deletions

View File

@ -13,16 +13,19 @@ func TestIssue156(t *testing.T) {
server := NewMothServer(Configuration{}, theme, state, puzzles)
afero.WriteFile(state, "teams/bloop", []byte("bloop: the team"), 0644)
afero.WriteFile(state, "teamids.txt", []byte("bloop"), 0644)
state.refresh()
handler := server.NewHandler("", "bloop")
es := handler.ExportState()
if _, ok := es.TeamNames["self"]; !ok {
t.Log("Team 'bloop' not found in exported state")
t.Fail()
}
err := handler.Register("bloop: the other team")
if err != ErrAlreadyRegistered {
t.Logf("Expected ErrAlreadyRegistered when registering team, received %s, instead", err)
t.Fail()
}
}