mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -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 {
|
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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ func TestAllianceSelectionErrors(t *testing.T) {
|
|||||||
assert.Contains(t, recorder.Body.String(), "Invalid team number")
|
assert.Contains(t, recorder.Body.String(), "Invalid team number")
|
||||||
recorder = web.postHttpResponse("/alliance_selection", "selection0_0=100")
|
recorder = web.postHttpResponse("/alliance_selection", "selection0_0=100")
|
||||||
assert.Equal(t, 200, recorder.Code)
|
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")
|
recorder = web.postHttpResponse("/alliance_selection", "selection0_0=101&selection1_1=101")
|
||||||
assert.Equal(t, 200, recorder.Code)
|
assert.Equal(t, 200, recorder.Code)
|
||||||
assert.Contains(t, recorder.Body.String(), "already part of an alliance")
|
assert.Contains(t, recorder.Body.String(), "already part of an alliance")
|
||||||
|
|||||||
Reference in New Issue
Block a user