Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yesod test getCookies utility #1815

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions yesod-test/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ChangeLog for yesod-test

## 1.6.17
* add `getCookies`. [#1815](https://github.com/yesodweb/yesod/pull/1815)

## 1.6.16

Expand Down
9 changes: 9 additions & 0 deletions yesod-test/Yesod/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ module Yesod.Test
-- * Grab information
, getTestYesod
, getResponse
, getCookies
, Cookies
, getRequestCookies

-- * Debug output
Expand Down Expand Up @@ -330,6 +332,13 @@ getTestYesod = fmap yedSite getSIO
getResponse :: YesodExample site (Maybe SResponse)
getResponse = fmap yedResponse getSIO

-- | Get the cookies set for the current test. Differs from `getRequestCookies`
-- in that this allows you to access cookies outside of a request builder
--
-- @since 1.6.17
getCookies :: YesodExample site Cookies
getCookies = fmap yedCookies getSIO

data RequestBuilderData site = RequestBuilderData
{ rbdPostData :: RBDPostData
, rbdResponse :: (Maybe SResponse)
Expand Down
2 changes: 1 addition & 1 deletion yesod-test/yesod-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: yesod-test
version: 1.6.16
version: 1.6.17
license: MIT
license-file: LICENSE
author: Nubis <[email protected]>
Expand Down