新着一覧の画面を追加(ジャンル切替、予告の除外、10分キャッシュ)

This commit is contained in:
2026-10-03 17:20:44 +09:00
parent ffe7451d04
commit f0d73a14e1
9 changed files with 518 additions and 13 deletions
+3 -3
View File
@@ -9,14 +9,14 @@ import (
func TestHealthz(t *testing.T) {
response := httptest.NewRecorder()
NewHandler().ServeHTTP(response, httptest.NewRequest(http.MethodGet, "/healthz", nil))
newTestHandler(&fakeFetcher{}, nil).ServeHTTP(response, httptest.NewRequest(http.MethodGet, "/healthz", nil))
if response.Code != http.StatusOK || response.Body.String() != "ok\n" {
t.Errorf("healthz: status=%d body=%q", response.Code, response.Body.String())
}
}
func TestPagesAndEmbeddedAssets(t *testing.T) {
handler := NewHandler()
handler := newTestHandler(&fakeFetcher{}, nil)
for _, tt := range []struct{ path, title string }{
{"/", "新着"}, {"/queue", "待ち行列"}, {"/subscriptions", "登録番組"}, {"/library", "ライブラリ"},
} {
@@ -42,7 +42,7 @@ func TestPagesAndEmbeddedAssets(t *testing.T) {
}
func TestUnknownPathsAndMethods(t *testing.T) {
handler := NewHandler()
handler := newTestHandler(&fakeFetcher{}, nil)
for _, tt := range []struct {
name, method, path string
wantStatus int