diff --git a/repositories/index_repository_test.go b/repositories/index_repository_test.go index 238606dd0..d0cea28ab 100644 --- a/repositories/index_repository_test.go +++ b/repositories/index_repository_test.go @@ -14,6 +14,7 @@ func TestIndexRepository(t *testing.T) { Convey("Subject: NewIndexRepository", t, func() { repo := NewArtistIndexRepository() + Convey("It should be able to read and write to the database", func() { i := &models.ArtistIndex{Id: "123"} @@ -22,13 +23,20 @@ func TestIndexRepository(t *testing.T) { So(s, shouldBeEqual, i) }) + Convey("Put() should return error if Id is not set", func() { + i := &models.ArtistIndex{} + + err := repo.Put(i) + + So(err, ShouldNotBeNil) + }) Convey("Given that I have 4 records", func() { for i := 1; i <= 4; i++ { e := &models.ArtistIndex{Id: strconv.Itoa(i)} repo.Put(e) } - Convey("When I call GetAll", func() { + Convey("When I call GetAll()", func() { indices, err := repo.GetAll() Convey("Then It should not return any error", func() { So(err, ShouldBeNil)