Files
dttmr-api/internal/api/handler/health_test.go
T

22 lines
442 B
Go

package handler_test
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"git.dittmar.dev/robin/dttmr-api/internal/api/handler"
)
func TestHealthHandler_Success(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/health", nil)
rr := httptest.NewRecorder()
handler.HealthHandler(rr, req)
assert.Equal(t, http.StatusOK, rr.Code)
assert.Equal(t, `{"status":"ok"}`, rr.Body.String())
}