From 6e99d20972bec95d3502ef7549d74f67b4cf0001 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sat, 27 Sep 2014 15:34:15 +0200 Subject: Initial commit (using Yesod's scaffolding) --- tests/HomeTest.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/HomeTest.hs (limited to 'tests/HomeTest.hs') diff --git a/tests/HomeTest.hs b/tests/HomeTest.hs new file mode 100644 index 0000000..25a23b1 --- /dev/null +++ b/tests/HomeTest.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE OverloadedStrings #-} +module HomeTest + ( homeSpecs + ) where + +import TestImport + +homeSpecs :: Spec +homeSpecs = + ydescribe "These are some example tests" $ do + + yit "loads the index and checks it looks right" $ do + get HomeR + statusIs 200 + htmlAllContain "h1" "Hello" + + 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" -- cgit v1.2.3