Merge pull request #77 from bitemyapp/doc-error-type

Add test for error parsing
This commit is contained in:
Chris Allen 2015-10-18 05:19:26 -05:00
commit 5b66b7c2ba

View File

@ -335,6 +335,11 @@ main = hspec $ do
validateStatus resp 200
validateStatus deleteResp 200
describe "error parsing" $ do
it "can parse EsErrors" $ withTestEnv $ do
res <- getDocument (IndexName "bogus") (MappingName "also_bogus") (DocId "bogus_as_well")
let errorResp = eitherDecode (responseBody res)
liftIO (errorResp `shouldBe` Right (EsError 404 "IndexMissingException[[bogus] missing]"))
describe "document API" $ do
it "indexes, gets, and then deletes the generated document" $ withTestEnv $ do