Files
Gardomatic/internal/web/handlers_test.go
T
kleiax 904d14b64c
CI / test (push) Canceled after 0s
Initial commit
2026-09-12 22:22:17 +02:00

22 lines
483 B
Go

package web
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestPing(t *testing.T) {
app := newTestApplication(t)
request := httptest.NewRequest(http.MethodGet, "/ping", nil)
response := httptest.NewRecorder()
app.routes().ServeHTTP(response, request)
if response.Code != http.StatusOK {
t.Errorf("status: got %d, want %d", response.Code, http.StatusOK)
}
if body := response.Body.String(); body != "OK" {
t.Errorf("body: got %q, want %q", body, "OK")
}
}