git.iko.soy/typeable/bloodhound
on master help sign in
Add test case for missing document parse
commitd9e8da1fc98bc76b53b65195735c64a04352669e authorMichael Xavier <michael@michaelxavier.net> dateMon 27 Jul 2015, 15:15 (11 years ago) parent92b5201
1 file changed+6
tests/tests.hs+6
tests/tests.hs+6
@@ -303,6 +303,12 @@ main = hspec $ do
303303 (responseBody docInserted) :: Either String (EsResult Tweet)
304304 liftIO $ (fmap getSource newTweet `shouldBe` Right (Just exampleTweet))
305305
306+ it "produces a parseable result when looking up a bogus document" $ withTestEnv $ do
307+ doc <- getDocument testIndex testMapping (DocId "bogus")
308+ let noTweet = eitherDecode
309+ (responseBody doc) :: Either String (EsResult Tweet)
310+ liftIO $ fmap foundResult noTweet `shouldBe` Right Nothing
311+
306312 it "can use optimistic concurrency control" $ withTestEnv $ do
307313 let ev = ExternalDocVersion minBound
308314 let cfg = defaultIndexDocumentSettings { idsVersionControl = ExternalGT ev }