@@ -50,15 +50,21 @@ func TestSetupSettingsDoubleElimination(t *testing.T) {
50
50
51
51
func TestSetupSettingsInvalidValues (t * testing.T ) {
52
52
web := setupTestWeb (t )
53
+ recorder := web .postHttpResponse ("/setup/settings" , "playoffType=SingleEliminationPlayoff&numPlayoffAlliances=8" )
54
+ assert .Equal (t , 303 , recorder .Code )
53
55
54
56
// Invalid number of alliances.
55
- recorder : = web .postHttpResponse ("/setup/settings" , "playoffType=SingleEliminationPlayoff&numAlliances=1" )
57
+ recorder = web .postHttpResponse ("/setup/settings" , "playoffType=SingleEliminationPlayoff&numAlliances=1" )
56
58
assert .Contains (t , recorder .Body .String (), "must be between 2 and 16" )
57
59
58
60
// Changing the playoff type after alliance selection is finalized.
59
61
assert .Nil (t , web .arena .Database .CreateAlliance (& model.Alliance {Id : 1 }))
60
- recorder = web .postHttpResponse ("/setup/settings" , "playoffType=SingleEliminationPlayoff&numPlayoffAlliances=8" )
61
- assert .Contains (t , recorder .Body .String (), "Cannot change playoff type after alliance selection" )
62
+ recorder = web .postHttpResponse ("/setup/settings" , "playoffType=DoubleEliminationPlayoff" )
63
+ assert .Contains (t , recorder .Body .String (), "Cannot change playoff type or size after alliance selection" )
64
+
65
+ // Changing the playoff size after alliance selection is finalized.
66
+ recorder = web .postHttpResponse ("/setup/settings" , "numPlayoffAlliances=2" )
67
+ assert .Contains (t , recorder .Body .String (), "Cannot change playoff type or size after alliance selection" )
62
68
}
63
69
64
70
func TestSetupSettingsClearDb (t * testing.T ) {
0 commit comments