From a97dd8bc0e94ab6d1d020c34af250d256bb181f1 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Sun, 6 Sep 2015 19:30:08 -0700 Subject: [PATCH] Tweak test cases: Add raw handler that should not be called (but is). --- servant-server/test/Servant/ServerSpec.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servant-server/test/Servant/ServerSpec.hs b/servant-server/test/Servant/ServerSpec.hs index 859e53fe..8798e69d 100644 --- a/servant-server/test/Servant/ServerSpec.hs +++ b/servant-server/test/Servant/ServerSpec.hs @@ -762,14 +762,16 @@ errorRoutingUser404Spec = type ErrorRoutingBodyParseError = "sum" :> ReqBody '[JSON] [Int] :> Post '[JSON] Int :<|> "const" :> Post '[JSON] Int + :<|> Raw errorRoutingBodyParseErrorSpec :: Spec errorRoutingBodyParseErrorSpec = describe "Broken request body triggers error response (not re-routing)" $ do - let hs = (return . sum) :<|> return 2 + let hs = (return . sum) :<|> return 2 :<|> (\_ cont -> cont (responseLBS ok200 [] "Raw")) describe "happy handlers" $ do go hs "/sum" "[1, 2]" "3" go hs "/const" "" ("2" { matchStatus = 201 }) + go hs "/n/a" "" "Raw" describe "parse error" $ do go hs "/sum" "@@@" 400 go hs "/const" "" ("2" { matchStatus = 201 })