refactor: use assertCookie and createUserWithCleanup helpers
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user