diff options
Diffstat (limited to 'tests/HomeTest.hs')
-rw-r--r-- | tests/HomeTest.hs | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/tests/HomeTest.hs b/tests/HomeTest.hs index 17c9e6d..25a23b1 100644 --- a/tests/HomeTest.hs +++ b/tests/HomeTest.hs @@ -1,24 +1,28 @@ +{-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs ) where -import Import -import Yesod.Test +import TestImport -homeSpecs :: Specs +homeSpecs :: Spec homeSpecs = - describe "These are some example tests" $ - it "loads the index and checks it looks right" $ do - get_ "/" - statusIs 200 - htmlAllContain "h1" "Hello" + ydescribe "These are some example tests" $ do - post "/" $ do - addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference - byLabel "What's on the file?" "Some Content" + yit "loads the index and checks it looks right" $ do + get HomeR + statusIs 200 + htmlAllContain "h1" "Hello" - statusIs 200 - htmlCount ".message" 1 - htmlAllContain ".message" "Some Content" - htmlAllContain ".message" "text/plain" + request $ do + setMethod "POST" + setUrl HomeR + addNonce + fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + byLabel "What's on the file?" "Some Content" + + statusIs 200 + printBody + htmlCount ".message" 1 + htmlAllContain ".message" "Some Content" + htmlAllContain ".message" "text/plain" |