Files
show-rss/src/cmd/server/handler/handler_test.go
2025-04-28 21:39:09 -06:00

22 lines
400 B
Go

package handler_test
import (
"context"
"net/http"
"net/http/httptest"
"show-rss/src/cmd/server/handler"
"show-rss/src/db"
"testing"
)
func TestHandler(t *testing.T) {
h := handler.New(db.Test(t, context.Background()))
w := httptest.NewRecorder()
r := httptest.NewRequest(http.MethodGet, "/not-found", nil)
h.ServeHTTP(w, r)
if w.Code != http.StatusNotFound {
t.Errorf("%+v", w)
}
}