Maximilian Tagher
92afb1150a
..
2019-11-24 15:56:42 -05:00
Maximilian Tagher
596db81d7a
..
2019-11-24 15:55:58 -05:00
Maximilian Tagher
6d0b723eb1
[yesod-test] Adds requireJSONResponse function
...
This function checks that a response body is JSON, and parses it into a Haskell value. Having something like this function is pretty essential to using Yesod as a JSON API server, so I think it's a good addition. You can use it to parse a Haskell record directly (usually by adding FromJSON classes to your response types), or parse a Value and pull out individual fields, maybe using something like `aeson-lens` (though probably a testing-specific library would be better).
I debated over these things:
1. The name. I was thinking of something like [assert/require/decode/parse]JSON[Response/Body]. I ultimately went with requireJSONResponse:
- decode/parse sound like the aeson functions that return Either or Maybe, and I wanted this function to throw an error if it failed
- I'm open to using `assertJSONResponse`—it matches the other functions (`assertEq`) better—but I think it reads less like English.
- I chose Response over Body because (a) It also checks the content-type header, which is not in the body (b) "Body" felt slightly in-the-weeds of HTTP; I think "response" is more approachable.
2. Should it require the JSON content type? You can definitely have a server that returns JSON without JSON content types, but I think that's a such a bad idea, it's more likely requiring it helps people if they accidentally don't add the header.
3. Should it take a String parameter to add to the error message? This would match `assertEq`, but other functions like `statusIs` don't take a message. Ultimately I went without it, because the messages felt like I was repeating myself: `(comment :: Comment) <- requireJSONResponse "the response has a comment"`
2019-11-24 15:31:05 -05:00
Maximilian Tagher
b0c07ea3cd
..
2019-11-19 23:13:11 -08:00
Maximilian Tagher
cbef19fae9
[yesod-test] Add testModifySite
2019-11-19 23:11:13 -08:00
Maximilian Tagher
a2d200c182
..
2019-11-17 12:43:24 -08:00
Maximilian Tagher
e39eaeef92
WIP - Add testModifySite
2019-11-17 12:42:20 -08:00
Maximilian Tagher
e4c493d199
..
2019-10-09 16:11:54 -07:00
Maximilian Tagher
ffd5ba0474
Add Basic Auth support to yesod-test
...
This allows setting username/password for HTTP basic auth, similar to the --user flag of curl.
2019-10-09 16:08:37 -07:00
Sebastián Estrella
32ecbd056d
Customize areq and wreq error message
2019-09-10 00:42:21 -05:00
Christopher League
fa90ab19ca
Update changelog
2019-08-19 15:57:15 -04:00
Christopher League
08a9632eba
yesod-test: correction to PR for multipart
2019-08-13 11:58:11 -04:00
Christopher League
3f98190645
Bump version to 1.6.6.2
2019-08-13 10:39:44 -04:00
Christopher League
a79f73a040
yesod-test: url-encode addPostParam keys & values
...
Fixes #1616
2019-08-13 10:34:57 -04:00
Christopher League
ac66323394
yesod-test: failing tests for encoding errors
...
Related to issue #1616
2019-08-13 10:29:21 -04:00
Michael Snoyman
006fa6cb9e
Update ChangeLog
2019-04-30 11:33:32 +03:00
Michael Snoyman
3b58652483
Compat with network 3
2019-04-30 05:13:10 +03:00
Jonathan Lamothe
6fe7ee6e0d
Documentation fix ( #1577 )
...
* fixed documentation
* bumped version
* updated ChangeLog
2019-01-26 12:53:04 +05:30
Maximilian Tagher
bedec86c74
[yesod-test] Add utility functions to modify cookies
2019-01-14 16:12:32 -08:00
Dan Burton
bff8200ae4
Updated changelogs and versions for #1561
2018-10-11 14:21:17 -04:00
Dan Burton
132abccff2
Compile with ghc 8.6 by pushing MonadFail usage into IO
2018-10-11 13:53:35 -04:00
Steven Leiva
0a089c8cb0
bodyEquals prints actual body.
2018-06-14 09:00:48 -05:00
ncaq
708648798e
deleted: unneed cabal build-depends by weeder
...
[weeder: Detect dead code](https://hackage.haskell.org/package/weeder )
deleted depends is
* mime-mail
* wai-eventsource
I sort build-depends, because duplicate depend some exist, to sort is detect to easy.
2018-06-09 13:15:21 +09:00
Tom Sydney Kerckhove
0aa1765b6c
Updated according to review
2018-04-26 11:00:48 +02:00
Tom Sydney Kerckhove
a8f5418b22
yesodSpecWithSiteGenerator with an argument
2018-04-26 10:50:51 +02:00
pythonissam
860ef4127a
Change the method in the example of performMethod
2018-04-14 06:47:32 +00:00
pythonissam
a9030aa294
make get and post use performMethod
2018-04-14 06:46:38 +00:00
pythonissam
7ad28d227c
Update ChangeLog.md
2018-04-14 06:10:59 +00:00
pythonissam
a7d42846b5
add performMethod
2018-04-14 06:08:15 +00:00
Maximilian Tagher
a0963e77b2
Merge branch 'master' into bylabel-contain
2018-02-09 22:20:02 -08:00
pythonissam
b8f93e6203
Update the version to 1.6.2
2018-02-10 04:16:07 +00:00
kotaro
acf956443d
Updated deprecation warnings accordingly
2018-02-10 08:28:24 +09:00
Ryan Scott
3408e1e630
Adapt to Semigroup changes in base-4.11
2018-02-04 20:09:37 -05:00
pythonissam
54614dd241
Update ChangeLog
2018-02-03 08:40:38 +00:00
pythonissam
88a23129fd
Version bump
2018-02-03 08:40:38 +00:00
pythonissam
d03e92ff9b
Add new fileByLabel-related functions
2018-02-03 08:40:29 +00:00
pythonissam
ed9306323c
Add missing fileByLabelWithMatch and make existing fileByLabel-related functions to use it
2018-02-03 08:39:52 +00:00
pythonissam
064f41d9e9
created new byLabel-related functions
2018-02-03 08:39:40 +00:00
Michael Snoyman
6830a9840c
Merge branch 'better-monads' into no-transformers
2018-01-17 06:43:52 +02:00
Michael Snoyman
e3bb03f9af
Missing import
2018-01-15 17:56:20 +02:00
Michael Snoyman
dff7f2372e
Switch to SIO
2018-01-15 17:38:36 +02:00
Michael Snoyman
a210ce59d7
Get it all compiling again
2018-01-15 17:08:55 +02:00
Michael Snoyman
25acc5799b
Version bumps and changelog updates
2018-01-15 15:57:36 +02:00
Michael Snoyman
fbccfe2306
Merge branch 'better-monads' into no-transformers
2018-01-11 22:49:02 +02:00
Michael Snoyman
65093b6b24
Merge branch 'master' into fix1459
2017-12-30 18:13:32 +02:00
Michael Snoyman
ed40b136ea
Fix broken Haddocks
2017-12-30 18:06:45 +02:00
Maximilian Tagher
51bdb66252
Fix Haddock syntax error and test failures introduced by #1459
2017-12-29 20:20:18 -05:00
kotaro
daa953ed1f
Add PR link into the deprecated pragmas
2017-12-27 09:47:57 +09:00
Michael Snoyman
1b22e6a908
Further transformer cleanup
2017-12-18 17:06:46 +02:00
kotaro
8e52b490fe
Insert deprecated pragmas for byLabel and fileByLabel
2017-12-18 14:10:12 +09:00
kotaro
8cf44ff7c8
Small fix of haddock
2017-12-18 13:34:16 +09:00
pythonissam
31903c34f8
fileByLabelExact: Created the exact version of fileByLabel
2017-12-17 08:50:48 +00:00
kotaro
baf30d0c9d
Improve comments
2017-12-04 17:12:51 +09:00
pythonissam
699203f5af
Update the Changelog
2017-12-02 10:14:24 +00:00
pythonissam
e5c04a0b8e
Version bump
2017-12-02 09:57:40 +00:00
pythonissam
db87b76816
Add version info
2017-12-02 09:56:56 +00:00
pythonissam
8f218307be
Improve the function name
2017-12-02 09:46:41 +00:00
pythonissam
57e25eaf39
Improve the document
2017-12-02 09:44:49 +00:00
pythonissam
8693c72c41
Remove the original nameFromLabel
2017-12-02 08:05:59 +00:00
pythonissam
70ec8c6823
new function genericNameFromLabel which abstracts the match methods
2017-12-02 08:00:31 +00:00
pythonissam
80aa45cf18
Simply, create the exact version of byLabel
2017-11-26 07:22:25 +00:00
pythonissam
cab78b65c2
Add a failure test case for byLabel
2017-11-26 04:45:02 +00:00
Maximilian Tagher
8208e3deac
Fix typo in Haddocks of assertEq
2017-11-15 11:32:59 -08:00
Michael Snoyman
4f14b9b82d
Add a stricter lower bound
2017-08-22 11:25:51 +03:00
Sebastián Estrella
0f28604cfe
Reduce verbosity using Monadic Forms
2017-08-22 02:24:26 -05:00
Sebastián Estrella
a58a4d88cd
Add implicit param HasCallStack to assertions
2017-07-19 22:47:00 -05:00
Mark Wotton
c40d39dc5a
one more since
2017-06-21 15:12:03 -04:00
Mark Wotton
7cd37db7c6
address review comments
2017-06-15 15:46:25 -04:00
Mark Wotton
1bc30deee7
import Control.Applicative for 7.8.4
2017-06-15 13:30:58 -04:00
Mark Wotton
2a112b5516
-Werror fixes
2017-06-15 12:17:49 -04:00
Mark Wotton
ee9ef1eac5
add clickOn function ( closes #1406 )
2017-06-14 13:40:44 -04:00
Amitai Burstein
b8d2647a6a
Add assertNotEq
2017-04-11 20:46:49 +03:00
Michael Snoyman
cdc6c8ae04
Version bumps/changelog updates
2017-02-08 11:20:31 +02:00
Michael Snoyman
aefd074efa
Cleanup GHC 8 redundant constraints
2017-02-05 13:35:12 +02:00
Michael Snoyman
3dc2d10b30
Compile with -Wall -Werror
2017-02-05 12:09:18 +02:00
Michael Snoyman
03c1ee4807
Compilation fix for GHC 7.8
2016-12-07 08:54:53 -05:00
Michael Snoyman
9c38a4b08e
Version bump for #1314
2016-12-01 06:53:41 +02:00
Jason Whittle
7b12f61a91
yesod-test: add getLocation test helper.
2016-11-30 18:05:48 -05:00
Amitaibu
827040f279
Fix error
2016-09-01 15:22:25 +03:00
Amitaibu
6ddfd07032
Add since tag
2016-09-01 14:20:29 +03:00
Amitaibu
ac0229dff0
Bump cabal version and export function
2016-09-01 14:19:38 +03:00
Amitaibu
21e0ef11ba
Add bodyNotContains function
2016-09-01 14:09:10 +03:00
Michael Snoyman
dae1a34d4c
Version bump for #1259
2016-08-10 08:48:57 +03:00
Chris Allen
13d9f58db7
Added assertEq, deprecated assertEqual
...
use assertEq instead
2016-08-10 00:08:24 -05:00
Maxime Bourget
6addf3923d
Changes spec name and bump version to 1.5.1.1
2016-04-12 21:42:33 +01:00
Maxime Bourget
3fecebd5ba
Allows more that one space between css selector.
...
This is needed to support addToken_ workaround before the fix.
Before the fix, an extra space was needed in the selector like this
example:
addToken "form.foo "
With the fix adding the missing space, code already adding a space
will end up with two spaces between the scope selector and the input one :
form.foo input[name=token_]
2016-04-11 21:58:50 +01:00
Maxime Bourget
62fc67a444
Fix addToken_ needing a trailing space to work.
...
The fix can add spaces in place where none or only one where expected.
The css parser has been modified to remove trailing or multiple spaces.
This might be a bit more lax that official CSS spec.
2016-04-11 21:15:27 +01:00
Mark Wotton
94109d9406
duplicated typesig
2016-03-21 17:46:28 -04:00
Mark Wotton
23278d651e
documentation fixes & formatting #3
2016-03-21 17:41:25 -04:00
Mark Wotton
b21e64637f
documentation fixes #2
2016-03-21 17:21:14 -04:00
Mark Wotton
f2341355c1
documentation fixes
2016-03-21 17:20:02 -04:00
Mark Wotton
ef00ddd80b
test result value, return URL in Right branch, document meaning in haddocks
2016-03-21 17:16:28 -04:00
Mark Wotton
92f24a73dc
better error messages for followRedirect
2016-03-21 13:44:26 -04:00
Mark Wotton
f381c69449
expand range of acceptable redirection codes
2016-03-21 13:43:36 -04:00
Mark Wotton
29c335af56
use Either rather than throwing an exception
2016-03-21 13:39:49 -04:00
Mark Wotton
62961ef931
fix exception test
2016-03-21 12:34:38 -04:00
Mark Wotton
df6834a335
add followRedirect
2016-03-21 12:13:23 -04:00
Michael Snoyman
89e39464a1
Changelog for #1191
2016-03-21 12:57:52 +02:00
Chris Allen
289471d122
appropriate version bump
2016-03-20 12:50:17 -05:00
Chris Allen
776007ffa3
better wording
2016-03-17 14:35:15 -05:00