20 lines
328 B
Go
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")
|
|
}
|