feat(sources): add managed RSS feeds (#41)

This commit is contained in:
2026-11-25 01:42:27 +01:00
parent 12acb36612
commit 136d9b3b59
38 changed files with 2103 additions and 67 deletions

View File

@ -0,0 +1,30 @@
package api_test
import (
"bytes"
"github.com/gin-gonic/gin"
"github.com/tradarr/backend/internal/api/handlers"
"github.com/tradarr/backend/internal/config"
"net/http"
"net/http/httptest"
"testing"
)
func TestTicket41RejectsNullConfigurationsBeforeDatabase(t *testing.T) {
const secret = "ticket41-null-fixture"
router := gin.New()
router.Use(gin.Recovery())
handler := handlers.New(nil, &config.Config{JWTSecret: secret}, nil, nil, nil, nil)
router.PUT("/api/admin/sources/:id", handler.UpdateSource)
for _, body := range []string{`null`, `{"enabled":true,"feed_urls":null}`} {
r := httptest.NewRequest(http.MethodPut, "/api/admin/sources/fixture", bytes.NewBufferString(body))
r.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()
router.ServeHTTP(w, r)
if w.Code != http.StatusBadRequest {
t.Error("null source configuration reached repository")
}
}
}