aboutsummaryrefslogtreecommitdiffstats
path: root/web/auth_test.go
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-15 13:48:34 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-15 13:48:34 -0800
commit2327f93098b4278c93055a96224ae82cef60b083 (patch)
tree1a5e647bfa520c108dc7750e34332ad312572bdc /web/auth_test.go
parent4c570c223e944a148dc81a4e1ee25d6ab524ae64 (diff)
downloadneko-2327f93098b4278c93055a96224ae82cef60b083.tar.gz
neko-2327f93098b4278c93055a96224ae82cef60b083.tar.bz2
neko-2327f93098b4278c93055a96224ae82cef60b083.zip
Backend: Fix linting issues, improve error handling, and replace magic numbers
Diffstat (limited to 'web/auth_test.go')
-rw-r--r--web/auth_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/auth_test.go b/web/auth_test.go
index 6f319b9..847d32d 100644
--- a/web/auth_test.go
+++ b/web/auth_test.go
@@ -36,7 +36,7 @@ func TestAuthenticationNoPassword(t *testing.T) {
wrappedHandler.ServeHTTP(rr, req)
if rr.Code != http.StatusOK {
- t.Errorf("Expected 200 OK when no password is set, got %d", rr.Code)
+ t.Errorf("Expected %d OK when no password is set, got %d", http.StatusOK, rr.Code)
}
body := rr.Body.String()
@@ -72,7 +72,7 @@ func TestAuthenticationWithPassword(t *testing.T) {
wrappedHandler.ServeHTTP(rr, req)
if rr.Code != http.StatusTemporaryRedirect {
- t.Errorf("Expected 307 redirect when not authenticated, got %d", rr.Code)
+ t.Errorf("Expected %d redirect when not authenticated, got %d", http.StatusTemporaryRedirect, rr.Code)
}
location := rr.Header().Get("Location")
@@ -125,7 +125,7 @@ func TestAuthenticationWithValidCookie(t *testing.T) {
wrappedHandler.ServeHTTP(rr, req)
if rr.Code != http.StatusOK {
- t.Errorf("Expected 200 OK with valid auth cookie, got %d", rr.Code)
+ t.Errorf("Expected %d OK with valid auth cookie, got %d", http.StatusOK, rr.Code)
}
}
@@ -145,7 +145,7 @@ func TestApiLoginNoPassword(t *testing.T) {
// Should succeed with any password (or empty) when no password is configured
if rr.Code != http.StatusOK {
- t.Errorf("Expected 200 OK for API login with no password configured, got %d", rr.Code)
+ t.Errorf("Expected %d OK for API login with no password configured, got %d", http.StatusOK, rr.Code)
}
}
@@ -164,7 +164,7 @@ func TestApiAuthStatusNoPassword(t *testing.T) {
// Should return authenticated:true when no password is set
if rr.Code != http.StatusOK {
- t.Errorf("Expected 200 OK for auth status with no password, got %d", rr.Code)
+ t.Errorf("Expected %d OK for auth status with no password, got %d", http.StatusOK, rr.Code)
}
body := rr.Body.String()