We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit a7b30ed7 authored by David L. L. Thomas's avatar David L. L. Thomas

Testing updates

parent be198c4a
......@@ -50,6 +50,8 @@ import qualified Language.Haskell.Exts.Annotated.Syntax as Src
import Control.Exception.Lifted
import System.IO (hPutStrLn, stderr)
type Spec = YesodSpec App
......@@ -141,11 +143,17 @@ adminLogin = do
statusIsResp :: Int -> YesodExample site ()
statusIsResp number = withResponse $ \ SResponse { simpleStatus = s } -> do
when (H.statusCode s /= number) printBody
liftIO $ flip HUnit.assertBool (H.statusCode s == number) $ concat
[ "Expected status was ", show number
, " but received status was ", show $ H.statusCode s
]
let errMsg = concat
[ "Expected status was ", show number
, " but received status was ", show $ H.statusCode s
]
when (H.statusCode s /= number) $ do
liftIO $ hPutStrLn stderr $ errMsg ++ ":"
printBody
liftIO $ hPutStrLn stderr ""
liftIO $ flip HUnit.assertBool (H.statusCode s == number) errMsg
marked :: QuasiQuoter
......
......@@ -27,8 +27,42 @@ wikiSpecs =
request $ do
addNonce
setUrl $ NewWikiR "snowdrift" "testpage"
setMethod "POST"
byLabel "Page Content" "test"
addPostParam "mode" "post"
statusIs 302
|]
yit "edits a wiki page" $ [marked|
login
get $ EditWikiR "snowdrift" "testpage"
statusIs 200
{- TODO - this needs to get the last_edit_id from the rendered page and pipe it through
request $ do
addNonce
setUrl $ WikiR "snowdrift" "testpage"
setMethod "POST"
byLabel "Page Content" "test after edit"
byLabel "Comment" "testing"
addPostParam "mode" "preview"
statusIs 200
request $ do
addNonce
setUrl $ WikiR "snowdrift" "testpage"
setMethod "POST"
byLabel "Page Content" "test after edit"
byLabel "Comment" "testing"
addPostParam "mode" "post"
statusIs 302
-}
|]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment