version 1 done
This commit is contained in:
commit
59e14ce390
47 changed files with 9188 additions and 0 deletions
28
test/Handler/ProfileSpec.hs
Normal file
28
test/Handler/ProfileSpec.hs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Handler.ProfileSpec (spec) where
|
||||
|
||||
import TestImport
|
||||
|
||||
spec :: Spec
|
||||
spec = withApp $ do
|
||||
|
||||
describe "Profile page" $ do
|
||||
it "asserts no access to my-account for anonymous users" $ do
|
||||
get ProfileR
|
||||
statusIs 403
|
||||
|
||||
it "asserts access to my-account for authenticated users" $ do
|
||||
userEntity <- createUser "foo"
|
||||
authenticateAs userEntity
|
||||
|
||||
get ProfileR
|
||||
statusIs 200
|
||||
|
||||
it "asserts user's information is shown" $ do
|
||||
userEntity <- createUser "bar"
|
||||
authenticateAs userEntity
|
||||
|
||||
get ProfileR
|
||||
let (Entity _ user) = userEntity
|
||||
htmlAnyContain ".username" . unpack $ userIdent user
|
||||
Loading…
Add table
Add a link
Reference in a new issue