Implemented getMediaFolders

This commit is contained in:
Deluan
2016-02-24 19:14:48 -05:00
parent 59b541e45d
commit 2f3c9a7603
5 changed files with 52 additions and 1 deletions
@@ -6,6 +6,7 @@ import (
. "github.com/deluan/gosonic/tests"
. "github.com/smartystreets/goconvey/convey"
"encoding/xml"
)
func TestGetMusicFolders(t *testing.T) {
@@ -15,6 +16,12 @@ func TestGetMusicFolders(t *testing.T) {
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="1" name="iTunes Library"`)
})
})
}