🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Testing for cover art content type
Deluan79a6965f99c0
diff --git a/api/get_cover_art.go b/api/get_cover_art.goindex f9e9a876f..227befb28 100644--- a/api/get_cover_art.go+++ b/api/get_cover_art.go@@ -44,7 +44,6 @@ func (c *GetCoverArtController) Get() {c.SendError(responses.ERROR_DATA_NOT_FOUND, "cover art not available")}- c.Ctx.Output.ContentType("image/jpg")c.Ctx.Output.Body(img)}diff --git a/api/get_cover_art_test.go b/api/get_cover_art_test.goindex 8abf473fd..76cb43edb 100644--- a/api/get_cover_art_test.go+++ b/api/get_cover_art_test.go@@ -43,12 +43,14 @@ func TestGetCoverArt(t *testing.T) {_, w := getCoverArt("id=NOT_FOUND")So(w.Body.Bytes(), ShouldMatchMD5, "963552b04e87a5a55e993f98a0fbdf82")+ So(w.Header().Get("Content-Type"), ShouldEqual, "image/png")})Convey("When id is found", func() {mockMediaFileRepo.SetData(`[{"Id":"2","HasCoverArt":true,"Path":"tests/fixtures/01 Invisible (RED) Edit Version.mp3"}]`, 1)_, w := getCoverArt("id=2")So(w.Body.Bytes(), ShouldMatchMD5, "e859a71cd1b1aaeb1ad437d85b306668")+ So(w.Header().Get("Content-Type"), ShouldEqual, "image/jpeg")})Reset(func() {mockMediaFileRepo.SetData("[]", 0)