Skip to content

Commit

Permalink
test: add doc not found test
Browse files Browse the repository at this point in the history
  • Loading branch information
jyecusch committed Sep 3, 2021
1 parent 6cafa72 commit 37894b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/plugins/document/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ func GetTests(docPlugin document.DocumentService) {
Expect(doc.Content).To(BeEquivalentTo(Customer1.Orders[0].Content))
})
})
When("Document Doesn't Exist", func() {
It("Should return NotFound error", func() {
key := document.Key{Collection: &document.Collection{Name: "items"}, Id: "not-exist"}
doc, err := docPlugin.Get(&key)
Expect(doc).To(BeNil())
Expect(err).Should(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("not found"))
})
})
})
}

Expand Down

0 comments on commit 37894b5

Please sign in to comment.