aboutsummaryrefslogtreecommitdiff
path: root/internal/webui/login_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/webui/login_test.go')
-rw-r--r--internal/webui/login_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/webui/login_test.go b/internal/webui/login_test.go
index fe27f7e..0d661cb 100644
--- a/internal/webui/login_test.go
+++ b/internal/webui/login_test.go
@@ -187,4 +187,27 @@ func TestLoginHandler(t *testing.T) {
err: &statusError{http.StatusNotFound, simpleErrorMessage},
},
})
+ // Test other request types
+ methods := []string{
+ http.MethodConnect,
+ http.MethodDelete,
+ http.MethodHead,
+ http.MethodOptions,
+ http.MethodPatch,
+ http.MethodPut,
+ http.MethodTrace,
+ }
+ for _, method := range methods {
+ runHttpTest(t, e, loginHandler, &httpTestCase{
+ name: "a login attempt with an invalid method should error",
+ input: httpTestInput{
+ method: method,
+ path: "/login",
+ },
+ expect: httpTestExpect{
+ code: http.StatusMethodNotAllowed,
+ err: &statusError{http.StatusMethodNotAllowed, simpleErrorMessage},
+ },
+ })
+ }
}