learn-go/snippetbox/cmd/web/handlers_test.go
2024-02-14 14:46:27 -08:00

20 lines
328 B
Go

package main
import (
"net/http"
"snippetbox.chaosfem.tw/internal/assert"
"testing"
)
func TestPing(t *testing.T) {
app := newTestApplication(t)
ts := newTestServer(t, app.routes())
defer ts.Close()
statusCode, _, body := ts.get(t, "/ping")
assert.Equal(t, statusCode, http.StatusOK)
assert.Equal(t, body, "OK")
}