diff options
author | Félix Sipma <felix.sipma@no-log.org> | 2014-11-10 11:00:47 +0100 |
---|---|---|
committer | Félix Sipma <felix.sipma@no-log.org> | 2014-11-10 11:00:47 +0100 |
commit | 316ebb8ad0e0febbba7f8ab14600a699419ed115 (patch) | |
tree | 858d646a4a851e75c22574840856df3459250153 /test | |
parent | 7555844dd54626d329d93f71f5c2d4d1fd3a26ab (diff) |
scaffolding updateangular
Diffstat (limited to 'test')
-rw-r--r-- | test/Handler/HomeSpec.hs | 26 | ||||
-rw-r--r-- | test/Spec.hs (renamed from test/main.hs) | 8 | ||||
-rw-r--r-- | test/TestImport.hs | 3 |
3 files changed, 30 insertions, 7 deletions
diff --git a/test/Handler/HomeSpec.hs b/test/Handler/HomeSpec.hs new file mode 100644 index 0000000..fd042d1 --- /dev/null +++ b/test/Handler/HomeSpec.hs @@ -0,0 +1,26 @@ +module Handler.HomeSpec + ( spec + ) where + +import TestImport + +spec :: Spec + 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" "test/Spec.hs" "text/plain" -- talk about self-reference + byLabel "What's on the file?" "Some Content" + + statusIs 200 + -- more debugging printBody + htmlCount ".message" 1 + htmlAllContain ".message" "Some Content" + htmlAllContain ".message" "text/plain" diff --git a/test/main.hs b/test/Spec.hs index a869b66..d179e28 100644 --- a/test/main.hs +++ b/test/Spec.hs @@ -1,7 +1,3 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE NoMonomorphismRestriction #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} - module Main where import Import @@ -10,7 +6,7 @@ import Yesod.Test import Test.Hspec (hspec) import Application (makeFoundation) -import HomeTest +import qualified Handler.HomeSpec main :: IO () main = do @@ -20,4 +16,4 @@ main = do foundation <- makeFoundation conf hspec $ do yesodSpec foundation $ do - homeSpecs + Handler.HomeSpec.spec diff --git a/test/TestImport.hs b/test/TestImport.hs index 2946b07..aafaf47 100644 --- a/test/TestImport.hs +++ b/test/TestImport.hs @@ -1,9 +1,9 @@ -{-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test , module Model , module Foundation , module Database.Persist + , module Prelude , runDB , Spec , Example @@ -13,6 +13,7 @@ import Yesod.Test import Database.Persist hiding (get) import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool) import Control.Monad.IO.Class (liftIO) +import Prelude import Foundation import Model |