Tweak test cases: Add raw handler that should not be called (but is).
This commit is contained in:
parent
bfdd0c5e9b
commit
a97dd8bc0e
1 changed files with 3 additions and 1 deletions
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue