@@ -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 }