mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 05:36:45 -04:00
Update alliance selection error message when picking a team who didn't play any qualification matches.
This commit is contained in:
@@ -76,7 +76,13 @@ func (web *Web) allianceSelectionPostHandler(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
web.renderAllianceSelection(w, r, fmt.Sprintf("Team %d is not present at this event.", teamId))
|
||||
web.renderAllianceSelection(
|
||||
w,
|
||||
r,
|
||||
fmt.Sprintf(
|
||||
"Team %d has not played any matches at this event and is ineligible for selection.", teamId,
|
||||
),
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func TestAllianceSelectionErrors(t *testing.T) {
|
||||
assert.Contains(t, recorder.Body.String(), "Invalid team number")
|
||||
recorder = web.postHttpResponse("/alliance_selection", "selection0_0=100")
|
||||
assert.Equal(t, 200, recorder.Code)
|
||||
assert.Contains(t, recorder.Body.String(), "not present at this event")
|
||||
assert.Contains(t, recorder.Body.String(), "ineligible for selection")
|
||||
recorder = web.postHttpResponse("/alliance_selection", "selection0_0=101&selection1_1=101")
|
||||
assert.Equal(t, 200, recorder.Code)
|
||||
assert.Contains(t, recorder.Body.String(), "already part of an alliance")
|
||||
|
||||
Reference in New Issue
Block a user