fix(tests): URL-encode series name in special characters test

The TestGetSeries_SpecialCharactersInName test was failing with a 400
status because the series name 'Series: Book & Other (Vol. 1)' was
interpolated directly into the URL without encoding. The ampersand was
parsed as a query parameter delimiter, corrupting the request.

Use url.QueryEscape() to properly encode the name parameter.
This commit is contained in:
2026-05-08 20:31:30 -04:00
parent 3bcae0abf5
commit a57694b738
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"testing"
"github.com/stretchr/testify/assert"
@@ -254,7 +255,7 @@ func (s *SeriesIntegrationTestSuite) TestGetSeriesBooks_Unauthorized() {
func (s *SeriesIntegrationTestSuite) TestGetSeries_SpecialCharactersInName() {
seriesName := "Series: Book & Other (Vol. 1)"
url := fmt.Sprintf("%s/api/series/books?library_id=%s&name=%s", s.setup.Server.URL, s.libraryID, seriesName)
url := fmt.Sprintf("%s/api/series/books?library_id=%s&name=%s", s.setup.Server.URL, s.libraryID, url.QueryEscape(seriesName))
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer "+s.token)