package calendartest import ( "net/http" "strings" "testing" ) // Standalone (no Home), signing out lands on a real page: the estilo // signed-out door at /signed-out, as Home mode's sign-out does, rather than // back on the sign-in form as if nothing happened. /signed-out used to 404 // without Home (Fable 5.1 follow-up finding 4 on #17). func TestStandaloneSignOutLandsOnTheSignedOutPage(t *testing.T) { app, session := signedIn(t, "someone@example.com") h := app.Handler() rec := postAs(t, h, session, "/signout", nil) if rec.Code != http.StatusSeeOther || rec.Header().Get("Location") != "/signed-out" { t.Fatalf("POST /signout: %d to %q, want 303 to /signed-out", rec.Code, rec.Header().Get("Location")) } if after := getAs(t, h, session, "/day/2026-09-24"); after.Code != http.StatusSeeOther { t.Fatalf("the session survived sign-out: GET a view answered %d", after.Code) } page := get(t, h, "/signed-out") body := page.Body.String() if page.Code != http.StatusOK || !strings.HasPrefix(page.Header().Get("Content-Type"), "text/html") { t.Fatalf("GET /signed-out: %d %s", page.Code, page.Header().Get("Content-Type")) } for _, want := range []string{ "