refactor: use assertCookie and createUserWithCleanup helpers
This commit is contained in:
1 parent
ff73d2919d
commit
b2d255cc0d
1 file changed
+1
-11
@@ -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