22 lines
400 B
Go
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)
|
|
}
|
|
}
|