initial commit

This commit is contained in:
Krzysztof
2025-08-01 18:01:55 +02:00
commit 9af1af7f92
73 changed files with 6531 additions and 0 deletions

22
test/logout_test.go Normal file
View File

@@ -0,0 +1,22 @@
package test
import (
"net/http"
"testing"
)
func TestLogout(t *testing.T) {
t.Run("user can log out", func(t *testing.T) {
tc := NewTestCase(t)
defer tc.Close()
tc.LogIn().
Get("/logout").
AssertStatusCode(http.StatusOK).
AssertRedirect(http.StatusSeeOther, "/login")
tc.AssertDatabaseCount("sessions", 0)
tc.Get("/").AssertRedirect(http.StatusSeeOther, "/login")
})
}