getIndexes returning list of artists and ignoredArticles

This commit is contained in:
Deluan 2016-03-01 13:15:23 -05:00
parent e0f214d356
commit 8e482bc494
3 changed files with 26 additions and 10 deletions

View file

@ -43,15 +43,18 @@ func TestGetIndexes(t *testing.T) {
So(err, ShouldBeNil)
})
Convey("Then it should return an empty collection", func() {
So(w.Body.String(), ShouldContainSubstring, "<indexes></indexes>")
So(w.Body.String(), ShouldContainSubstring, `<indexes ignoredArticles="The El La Los Las Le Les Os As O A"></indexes>`)
})
})
Convey("When the index is not empty", func() {
mockRepo.data = makeMockData(`[{"Id": "A","Artists": []}]`, 2)
mockRepo.data = makeMockData(`[{"Id": "A","Artists": [
{"ArtistId": "21", "Artist": "Afrolicious"}
]}]`, 2)
_, w := Get(AddParams("/rest/getIndexes.view"), "TestGetIndexes")
Convey("Then it should return the the items in the response", func() {
So(w.Body.String(), ShouldContainSubstring, `<index name="A"></index>`)
So(w.Body.String(), ShouldContainSubstring,
`<indexes ignoredArticles="The El La Los Las Le Les Os As O A"><index name="A"><artist id="21" name="Afrolicious"></artist></index></indexes>`)
})
})
Reset(func() {