yesod-test 1.2.3 → 1.2.3.1
raw patch · 3 files changed
+19/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Yesod/Test.hs +7/−4
- test/main.hs +11/−0
- yesod-test.cabal +1/−1
Yesod/Test.hs view
@@ -421,10 +421,10 @@ Just res -> return res let body = simpleBody res- mfor = parseHTML body+ mlabel = parseHTML body $// C.element "label" >=> contentContains label- >=> attribute "for"+ mfor = mlabel >>= attribute "for" contentContains x c | x `T.isInfixOf` T.concat (c $// content) = [c]@@ -444,8 +444,11 @@ , " which was not found. " ] name:_ -> return name- _ -> failure $ "More than one input with id " <> for- [] -> failure $ "No label contained: " <> label+ [] -> failure $ "No input with id " <> for+ [] ->+ case filter (/= "") $ mlabel >>= (child >=> C.element "input" >=> attribute "name") of+ [] -> failure $ "No label contained: " <> label+ name:_ -> return name _ -> failure $ "More than one label contained " <> label (<>) :: T.Text -> T.Text -> T.Text
test/main.hs view
@@ -132,6 +132,14 @@ get ("/dynamic2/שלום" :: Text) statusIs 200 bodyEquals "שלום"++ ydescribe "labels" $ do+ yit "can click checkbox" $ do+ get ("/labels" :: Text)+ request $ do+ setMethod "POST"+ setUrl ("/labels" :: Text)+ byLabel "Foo Bar" "yes" describe "cookies" $ yesodSpec cookieApp $ do yit "should send the cookie #730" $ do get ("/" :: Text)@@ -173,6 +181,9 @@ _ -> defaultLayout widget onStatic "html" $ dispatchTo $ return ("<html><head><title>Hello</title></head><body><p>Hello World</p><p>Hello Moon</p></body></html>" :: Text)++ onStatic "labels" $ dispatchTo $+ return ("<html><label><input type='checkbox' name='fooname' id='foobar'>Foo Bar</label></html>" :: Text) cookieApp :: LiteApp
yesod-test.cabal view
@@ -1,5 +1,5 @@ name: yesod-test-version: 1.2.3+version: 1.2.3.1 license: MIT license-file: LICENSE author: Nubis <nubis@woobiz.com.ar>