navidrome/persistence/mediafile_repository_test.go

30 lines
609 B
Go
Raw Normal View History

2020-01-16 21:56:24 +01:00
package persistence
import (
2020-01-18 07:56:17 +01:00
"os"
"path/filepath"
"github.com/astaxie/beego/orm"
2020-01-16 21:56:24 +01:00
"github.com/cloudsonic/sonic-server/model"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("MediaFileRepository", func() {
var repo model.MediaFileRepository
BeforeEach(func() {
repo = NewMediaFileRepository(orm.NewOrm())
2020-01-16 21:56:24 +01:00
})
Describe("FindByPath", func() {
It("returns all records from a given ArtistID", func() {
2020-01-18 07:56:17 +01:00
path := string(os.PathSeparator) + filepath.Join("beatles", "1")
Expect(repo.FindByPath(path)).To(Equal(model.MediaFiles{
2020-01-16 21:56:24 +01:00
songComeTogether,
}))
})
})
})