mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-29 13:31:01 +02:00
More coverage on web package
This commit is contained in:
@ -19,4 +19,20 @@ func TestViewerPageGET(t *testing.T) {
|
||||
if w.Code != http.StatusOK {
|
||||
t.Errorf("Viewer page returned %v != %v on GET", w.Code, http.StatusOK)
|
||||
}
|
||||
|
||||
// Test GET request on not found page
|
||||
r, _ = http.NewRequest("GET", "", nil)
|
||||
w = httptest.NewRecorder()
|
||||
http.HandlerFunc(viewerHandler).ServeHTTP(w, r)
|
||||
if w.Code != http.StatusNotFound {
|
||||
t.Errorf("Viewer page returned %v != %v on GET", w.Code, http.StatusOK)
|
||||
}
|
||||
|
||||
// Test GET request on statistics page
|
||||
r, _ = http.NewRequest("GET", "/", nil)
|
||||
w = httptest.NewRecorder()
|
||||
http.HandlerFunc(statisticsHandler).ServeHTTP(w, r)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Errorf("Viewer page returned %v != %v on GET", w.Code, http.StatusOK)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user