address review comments

This commit is contained in:
Mark Wotton 2017-06-15 15:46:25 -04:00
parent 1bc30deee7
commit 7cd37db7c6
3 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,7 @@
## 1.5.7
* Add clickOn
* Add clickOn.
[#1408](https://github.com/yesodweb/yesod/pull/1408)
## 1.5.6

View File

@ -831,6 +831,13 @@ setUrl url' = do
, rbdGets = rbdGets rbd ++ H.parseQuery (TE.encodeUtf8 urlQuery)
}
-- | Click on a link defined by a CSS query
--
-- ==== __ Examples__
--
-- > get "/foobar"
-- > clickOn "a#idofthelink"
clickOn :: Yesod site => Query -> YesodExample site ()
clickOn query = do
withResponse' yedResponse ["Tried to invoke clickOn in order to read HTML of a previous response."] $ \ res ->

View File

@ -174,6 +174,7 @@ main = hspec $ do
get ("/htmlWithLink" :: Text)
clickOn "a#thelink"
statusIs 200
bodyEquals "<html><head><title>Hello</title></head><body><p>Hello World</p><p>Hello Moon</p></body></html>"
get ("/htmlWithLink" :: Text)
(bad :: Either SomeException ()) <- try (clickOn "a#nonexistentlink")