git.iko.soy/typeable/bloodhound
on master help sign in
Add test for error parsing
commit7d4ffefc151db39407409f8c190a701cad61f329 authorMichael Xavier <michael@michaelxavier.net> dateFri 16 Oct 2015, 23:58 (11 years ago) parentc3dbab9
1 file changed+5
tests/tests.hs+5
tests/tests.hs+5
@@ -335,6 +335,11 @@ main = hspec $ do
335335 validateStatus resp 200
336336 validateStatus deleteResp 200
337337
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]"))
338343
339344 describe "document API" $ do
340345 it "indexes, gets, and then deletes the generated document" $ withTestEnv $ do