mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Fix lint issues
This commit is contained in:
@@ -95,7 +95,7 @@ func TestAuthenticateMiddleware(t *testing.T) {
|
||||
|
||||
// Create test handler
|
||||
nextCalled := false
|
||||
next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
next := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
nextCalled = true
|
||||
w.WriteHeader(http.StatusOK)
|
||||
})
|
||||
|
||||
@@ -165,7 +165,9 @@ func TestRefreshSession(t *testing.T) {
|
||||
ExpiresAt: time.Now().Add(24 * time.Hour),
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
mockDB.CreateSession(session)
|
||||
if err := mockDB.CreateSession(session); err != nil {
|
||||
t.Fatalf("failed to create session: %v", err)
|
||||
}
|
||||
return token
|
||||
},
|
||||
wantErr: false,
|
||||
@@ -181,7 +183,9 @@ func TestRefreshSession(t *testing.T) {
|
||||
ExpiresAt: time.Now().Add(-1 * time.Hour), // Expired
|
||||
CreatedAt: time.Now().Add(-2 * time.Hour),
|
||||
}
|
||||
mockDB.CreateSession(session)
|
||||
if err := mockDB.CreateSession(session); err != nil {
|
||||
t.Fatalf("failed to create session: %v", err)
|
||||
}
|
||||
return token
|
||||
},
|
||||
wantErr: true,
|
||||
@@ -255,7 +259,9 @@ func TestInvalidateSession(t *testing.T) {
|
||||
ExpiresAt: time.Now().Add(24 * time.Hour),
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
mockDB.CreateSession(session)
|
||||
if err := mockDB.CreateSession(session); err != nil {
|
||||
t.Fatalf("failed to create session: %v", err)
|
||||
}
|
||||
return session.ID
|
||||
},
|
||||
wantErr: false,
|
||||
|
||||
Reference in New Issue
Block a user