summaryrefslogtreecommitdiff
path: root/tests/HomeTest.hs
diff options
context:
space:
mode:
authorClint Adams <clint@softwarefreedom.org>2013-04-19 17:57:46 -0400
committerClint Adams <clint@softwarefreedom.org>2013-04-19 17:57:46 -0400
commit514ff2acff2ba9ad9f809e22fc8ed5a986410e5d (patch)
treebe57afe59d966d65910b4f9336a0370f9ca18b26 /tests/HomeTest.hs
Initial stab.
Diffstat (limited to 'tests/HomeTest.hs')
-rw-r--r--tests/HomeTest.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/HomeTest.hs b/tests/HomeTest.hs
new file mode 100644
index 0000000..17c9e6d
--- /dev/null
+++ b/tests/HomeTest.hs
@@ -0,0 +1,24 @@
+module HomeTest
+ ( homeSpecs
+ ) where
+
+import Import
+import Yesod.Test
+
+homeSpecs :: Specs
+homeSpecs =
+ describe "These are some example tests" $
+ it "loads the index and checks it looks right" $ do
+ get_ "/"
+ statusIs 200
+ htmlAllContain "h1" "Hello"
+
+ post "/" $ do
+ addNonce
+ fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference
+ byLabel "What's on the file?" "Some Content"
+
+ statusIs 200
+ htmlCount ".message" 1
+ htmlAllContain ".message" "Some Content"
+ htmlAllContain ".message" "text/plain"