git.iko.soy/typeable/servant
on master help sign in
Add test for failing 400
3bd3effJulian K. Arni
servant-server/test/Servant/Server/ErrorSpec.hs+4
@@ -168,6 +168,10 @@ errorRetrySpec = describe "Handler search"
168 request methodGet "a" [jsonCT, jsonAccept] jsonBody
168 request methodGet "a" [jsonCT, jsonAccept] jsonBody
169 `shouldRespondWith` 200 { matchBody = Just $ encode (4 :: Int) }
169 `shouldRespondWith` 200 { matchBody = Just $ encode (4 :: Int) }
170
170
171+ it "should not continue when body cannot be decoded" $ do
172+ request methodPost "a" [jsonCT, jsonAccept] "a string"
173+ `shouldRespondWith` 400
174+
171-- }}}
175-- }}}
172------------------------------------------------------------------------------
176------------------------------------------------------------------------------
173-- * Error Choice {{{
177-- * Error Choice {{{