Add GetGenre endpoint

This commit is contained in:
Deluan
2020-01-15 17:49:09 -05:00
parent ca2c897340
commit 36d93774bc
22 changed files with 303 additions and 26 deletions
+22
View File
@@ -0,0 +1,22 @@
package persistence
import (
"github.com/cloudsonic/sonic-server/model"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("GenreRepository", func() {
var repo model.GenreRepository
BeforeEach(func() {
repo = NewGenreRepository()
})
It("returns all records", func() {
genres, err := repo.GetAll()
Expect(err).To(BeNil())
Expect(genres).To(ContainElement(model.Genre{Name: "Rock", AlbumCount: 2, SongCount: 2}))
Expect(genres).To(ContainElement(model.Genre{Name: "Electronic", AlbumCount: 1, SongCount: 2}))
})
})