mirror of https://github.com/dirtbags/moth.git
Fixing issue with TestIssue156 due to change in registration behavior
This commit is contained in:
parent
72d5a79798
commit
368e7306c3
|
@ -13,16 +13,19 @@ func TestIssue156(t *testing.T) {
|
||||||
server := NewMothServer(Configuration{}, theme, state, puzzles)
|
server := NewMothServer(Configuration{}, theme, state, puzzles)
|
||||||
|
|
||||||
afero.WriteFile(state, "teams/bloop", []byte("bloop: the team"), 0644)
|
afero.WriteFile(state, "teams/bloop", []byte("bloop: the team"), 0644)
|
||||||
|
afero.WriteFile(state, "teamids.txt", []byte("bloop"), 0644)
|
||||||
state.refresh()
|
state.refresh()
|
||||||
|
|
||||||
handler := server.NewHandler("", "bloop")
|
handler := server.NewHandler("", "bloop")
|
||||||
es := handler.ExportState()
|
es := handler.ExportState()
|
||||||
if _, ok := es.TeamNames["self"]; !ok {
|
if _, ok := es.TeamNames["self"]; !ok {
|
||||||
|
t.Log("Team 'bloop' not found in exported state")
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
err := handler.Register("bloop: the other team")
|
err := handler.Register("bloop: the other team")
|
||||||
if err != ErrAlreadyRegistered {
|
if err != ErrAlreadyRegistered {
|
||||||
|
t.Logf("Expected ErrAlreadyRegistered when registering team, received %s, instead", err)
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue