mirror of
https://github.com/taigrr/pastebin
synced 2026-04-13 19:28:05 -07:00
feat: add graceful shutdown, health endpoint, and improved client API
This commit is contained in:
@@ -353,6 +353,19 @@ func TestPasteRoundTripSpecialChars(t *testing.T) {
|
||||
assert.Equal(t, specialContent, viewRec.Body.String())
|
||||
}
|
||||
|
||||
func TestHealthzHandler(t *testing.T) {
|
||||
server := newTestServer()
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/healthz", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
server.mux.ServeHTTP(rec, req)
|
||||
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
assert.Contains(t, rec.Header().Get("Content-Type"), "application/json")
|
||||
assert.Contains(t, rec.Body.String(), `"status":"healthy"`)
|
||||
}
|
||||
|
||||
func TestViewWithTabs(t *testing.T) {
|
||||
server := newTestServer()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user