mirror of
https://github.com/airlabspl/uptimemonitor.git
synced 2025-08-14 12:19:19 +02:00
23 lines
398 B
Go
23 lines
398 B
Go
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")
|
|
})
|
|
}
|