diff options
Diffstat (limited to 'app/handler_test.go')
| -rw-r--r-- | app/handler_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/handler_test.go b/app/handler_test.go index 67692b0..53d8775 100644 --- a/app/handler_test.go +++ b/app/handler_test.go @@ -33,3 +33,18 @@ func BenchmarkIndexHandler(b *testing.B) { IndexHandler(response, request) } } + +func TestAdminHandler(t *testing.T) { + request, err := http.NewRequest("GET", "/admin", nil) + if err != nil { + t.Log("Error creating new http request. ", err) + } + response := httptest.NewRecorder() + + AdminHandler(response, request) + + if response.Code != 302 { + t.Log(response.Code) + t.Fatal("Expected 403 as status code.") + } +} |
