Test viewer page
This commit is contained in:
parent
6c7ac2d3b3
commit
503fb2698b
|
@ -0,0 +1,16 @@
|
||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestViewerPageGET(t *testing.T) {
|
||||||
|
r, _ := http.NewRequest("GET", "", nil)
|
||||||
|
w := httptest.NewRecorder()
|
||||||
|
http.HandlerFunc(viewerHandler).ServeHTTP(w, r)
|
||||||
|
if w.Code != http.StatusOK {
|
||||||
|
t.Errorf("Viewer page didn't return %v on GET", http.StatusOK)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue