git.iko.soy/typeable/bloodhound
on master help sign in
Merge pull request #77 from bitemyapp/doc-error-type
5b66b7cChris Allen
tests/tests.hs+5
@@ -335,6 +335,11 @@ main = hspec $ do
335 validateStatus resp 200
335 validateStatus resp 200
336 validateStatus deleteResp 200
336 validateStatus deleteResp 200
337
337
338+ describe "error parsing" $ do
339+ it "can parse EsErrors" $ withTestEnv $ do
340+ res <- getDocument (IndexName "bogus") (MappingName "also_bogus") (DocId "bogus_as_well")
341+ let errorResp = eitherDecode (responseBody res)
342+ liftIO (errorResp `shouldBe` Right (EsError 404 "IndexMissingException[[bogus] missing]"))
338
343
339 describe "document API" $ do
344 describe "document API" $ do
340 it "indexes, gets, and then deletes the generated document" $ withTestEnv $ do
345 it "indexes, gets, and then deletes the generated document" $ withTestEnv $ do