wai-extra-3.1.16: Provides some basic WAI handlers and middleware.
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Test

Synopsis

Session

type Session = ReaderT Application (StateT ClientState IO) Source #

runSession :: Session a -> Application -> IO a Source #

See also: runSessionWith.

withSession :: Application -> Session a -> IO a Source #

Synonym for 'flip runSession'

Client Cookies

type ClientCookies = Map ByteString SetCookie Source #

Since 3.0.6

setClientCookie :: SetCookie -> Session () Source #

Since 3.0.6

deleteClientCookie :: ByteString -> Session () Source #

Since 3.0.6

Requests

srequest :: SRequest -> Session SResponse Source #

Similar to request, but allows setting the request body as a plain ByteString.

data SRequest Source #

Constructors

SRequest 

Fields

data SResponse Source #

Constructors

SResponse 

Fields

Instances

Instances details
Show SResponse Source # 
Instance details

Defined in Network.Wai.Test

Methods

showsPrec :: Int -> SResponse -> ShowS

show :: SResponse -> String

showList :: [SResponse] -> ShowS

Eq SResponse Source # 
Instance details

Defined in Network.Wai.Test

Methods

(==) :: SResponse -> SResponse -> Bool

(/=) :: SResponse -> SResponse -> Bool

defaultRequest :: Request #

setPath :: Request -> ByteString -> Request Source #

Set whole path (request path + query string).

setRawPathInfo :: Request -> ByteString -> Request Source #

Assertions

assertStatus :: HasCallStack => Int -> SResponse -> Session () Source #

assertContentType :: HasCallStack => ByteString -> SResponse -> Session () Source #

assertBody :: HasCallStack => ByteString -> SResponse -> Session () Source #

assertBodyContains :: HasCallStack => ByteString -> SResponse -> Session () Source #

assertHeader :: HasCallStack => CI ByteString -> ByteString -> SResponse -> Session () Source #

assertNoHeader :: HasCallStack => CI ByteString -> SResponse -> Session () Source #

assertClientCookieExists :: HasCallStack => String -> ByteString -> Session () Source #

Since 3.0.6

assertNoClientCookieExists :: HasCallStack => String -> ByteString -> Session () Source #

Since 3.0.6

assertClientCookieValue :: HasCallStack => String -> ByteString -> ByteString -> Session () Source #

Since 3.0.6