{-# 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 loc <- getLocation assertEq "Redirect is to Login" loc either (fail . unpack) (\_ -> return ()) =<< followRedirect statusIs 200 it "asserts access to my-account for authenticated users" $ do userEntity <- createUser "foo" authenticateAs userEntity get ProfileR statusIs 200