Add a failure test case for byLabel
This commit is contained in:
parent
c21e77947c
commit
cab78b65c2
@ -215,6 +215,15 @@ main = hspec $ do
|
||||
setMethod "POST"
|
||||
setUrl ("/labels" :: Text)
|
||||
byLabel "Foo Bar" "yes"
|
||||
ydescribe "labels2" $ do
|
||||
yit "fails with \"More than one label contained\" error" $ do
|
||||
get ("/labels2" :: Text)
|
||||
(bad :: Either SomeException ()) <- try (request $ do
|
||||
setMethod "POST"
|
||||
setUrl ("labels2" :: Text)
|
||||
byLabel "hobby" "fishing")
|
||||
assertEq "failure wasn't called" (isLeft bad) True
|
||||
|
||||
ydescribe "Content-Type handling" $ do
|
||||
yit "can set a content-type" $ do
|
||||
request $ do
|
||||
@ -362,6 +371,8 @@ app = liteApp $ do
|
||||
return ("<html><head><title>A link</title></head><body><a href=\"/html\" id=\"thelink\">Link!</a></body></html>" :: Text)
|
||||
onStatic "labels" $ dispatchTo $
|
||||
return ("<html><label><input type='checkbox' name='fooname' id='foobar'>Foo Bar</label></html>" :: Text)
|
||||
onStatic "labels2" $ dispatchTo $
|
||||
return ("<html><label for='hobby'>hobby</label><label for='hobby2'>hobby2</label><input type='text' name='hobby' id='hobby'><input type='text' name='hobby2' id='hobby2'></html>" :: Text)
|
||||
|
||||
onStatic "checkContentType" $ dispatchTo $ do
|
||||
headers <- requestHeaders <$> waiRequest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user