refactor: use assertCookie and createUserWithCleanup helpers

This commit is contained in:
2025-11-13 08:16:06 +01:00
parent ff73d2919d
commit b2d255cc0d

View File

@@ -185,17 +185,7 @@ func TestIntegration_PageHandlerFormWorkflows(t *testing.T) {
freshCtx.Router.ServeHTTP(rec, req) freshCtx.Router.ServeHTTP(rec, req)
assertStatus(t, rec, http.StatusSeeOther) assertStatus(t, rec, http.StatusSeeOther)
cookies := rec.Result().Cookies() assertCookie(t, rec, "auth_token", "")
authCookieSet := false
for _, cookie := range cookies {
if cookie.Name == "auth_token" && cookie.Value != "" {
authCookieSet = true
break
}
}
if !authCookieSet {
t.Error("Expected auth cookie to be set on login")
}
}) })
t.Run("Email_Confirmation_Page_Handler", func(t *testing.T) { t.Run("Email_Confirmation_Page_Handler", func(t *testing.T) {