Skip to content

🎧 Your Personal Streaming Service

Fixed an allocation bug, and tests

Deluanb8698439866d
diff --git a/repositories/index_repository.go b/repositories/index_repository.go
index 83112e6a0..a9cd83110 100644
--- a/repositories/index_repository.go
+++ b/repositories/index_repository.go
@@ -29,7 +29,7 @@ func (r *ArtistIndex) Get(id string) (*models.ArtistIndex, error) {
}
func (r *ArtistIndex) GetAll() ([]models.ArtistIndex, error) {
- var indices = make([]models.ArtistIndex, 30)
+ var indices = make([]models.ArtistIndex, 0)
err := r.loadAll(&indices)
return indices, err
}
diff --git a/repositories/index_repository_test.go b/repositories/index_repository_test.go
index d0cea28ab..b184e04a2 100644
--- a/repositories/index_repository_test.go
+++ b/repositories/index_repository_test.go
@@ -41,10 +41,10 @@ func TestIndexRepository(t *testing.T) {
Convey("Then It should not return any error", func() {
So(err, ShouldBeNil)
})
- SkipConvey("And It should return 4 entities", func() {
- So(len(indices), ShouldEqual, 4)
+ Convey("And It should return 4 entities", func() {
+ So(indices, ShouldHaveLength, 4)
})
- SkipConvey("And the values should be retrieved", func() {
+ Convey("And the values should be retrieved", func() {
for _, e := range indices {
So(e.Id, ShouldBeIn, []string{"1", "2", "3", "4"})
}