mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-10 11:32:48 +02:00
28 lines
680 B
Go
28 lines
680 B
Go
package api_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"encoding/xml"
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
"github.com/deluan/gosonic/tests"
|
|
)
|
|
|
|
func TestGetMusicFolders(t *testing.T) {
|
|
tests.Init(t, false)
|
|
|
|
_, w := Get(AddParams("/rest/getMusicFolders.view"), "TestGetMusicFolders")
|
|
|
|
Convey("Subject: GetMusicFolders Endpoint", t, func() {
|
|
Convey("Status code should be 200", func() {
|
|
So(w.Code, ShouldEqual, 200)
|
|
})
|
|
Convey("The response should include the default folder", func() {
|
|
v := new(string)
|
|
err := xml.Unmarshal(w.Body.Bytes(), &v)
|
|
So(err, ShouldBeNil)
|
|
So(w.Body.String(), ShouldContainSubstring, `musicFolder id="0" name="iTunes Library"`)
|
|
})
|
|
})
|
|
}
|