mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-10 11:32:48 +02:00
28 lines
628 B
Go
28 lines
628 B
Go
package api_test
|
|
|
|
import (
|
|
"encoding/xml"
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
"testing"
|
|
"github.com/deluan/gosonic/tests"
|
|
)
|
|
|
|
func TestGetLicense(t *testing.T) {
|
|
tests.Init(t, false)
|
|
|
|
_, w := Get(AddParams("/rest/getLicense.view"), "TestGetLicense")
|
|
|
|
Convey("Subject: GetLicense Endpoint", t, func() {
|
|
Convey("Status code should be 200", func() {
|
|
So(w.Code, ShouldEqual, 200)
|
|
})
|
|
Convey("The license should always be valid", func() {
|
|
v := new(string)
|
|
err := xml.Unmarshal(w.Body.Bytes(), &v)
|
|
So(err, ShouldBeNil)
|
|
So(w.Body.String(), ShouldContainSubstring, `license valid="true"`)
|
|
})
|
|
|
|
})
|
|
}
|