From 797339cbd2468a6cca40c3b9b033e0a5ead1ca29 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 25 Apr 2012 06:54:13 +0300 Subject: [PATCH] yesod-test: use correct nonce/token key --- yesod-test/Yesod/Test.hs | 4 ++-- yesod-test/yesod-test.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index 6bd1f44d..642010b5 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -324,10 +324,10 @@ fileByLabel label path mime = do -- Receives a CSS selector that should resolve to the form element containing the nonce. addNonce_ :: Query -> RequestBuilder () addNonce_ scope = do - matches <- htmlQuery $ scope `mappend` "input[name=_nonce][type=hidden][value]" + matches <- htmlQuery $ scope `mappend` "input[name=_token][type=hidden][value]" case matches of [] -> failure $ "No nonce found in the current page" - element:[] -> byName "_nonce" $ head $ parseHTML element $ getAttrValue "value" + element:[] -> byName "_token" $ head $ parseHTML element $ getAttrValue "value" _ -> failure $ "More than one nonce found in the page" -- | For responses that display a single form, just lookup the only nonce available. diff --git a/yesod-test/yesod-test.cabal b/yesod-test/yesod-test.cabal index e4f7dc0d..10baf09e 100644 --- a/yesod-test/yesod-test.cabal +++ b/yesod-test/yesod-test.cabal @@ -1,5 +1,5 @@ name: yesod-test -version: 0.2.0.2 +version: 0.2.0.3 license: MIT license-file: LICENSE author: Nubis