mirror of
https://github.com/airlabspl/uptimemonitor.git
synced 2025-08-15 04:39:15 +02:00
initial commit
This commit is contained in:
22
test/logout_test.go
Normal file
22
test/logout_test.go
Normal 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")
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user