Michael Snoyman
804b114d91
Drop LTS 9
2020-01-07 13:36:58 +02:00
Michael Snoyman
dc16761492
Merge pull request #1649 from yesodweb/yesodPersistentCompatibility
...
Add extensions for yesod-persistent tests to be compatible with lates…
2020-01-03 07:38:07 +02:00
Maximilian Tagher
a8a7b6c7a5
..
2020-01-02 22:51:54 -05:00
Maximilian Tagher
367d77a8c3
..
2020-01-02 22:00:13 -05:00
Maximilian Tagher
cf365d18a2
Add extensions for yesod-persistent tests to be compatible with latest persistent-template
...
The upcoming version of persistent-template will require these yesodweb/persistent#1002
2020-01-02 21:57:00 -05:00
Maximilian Tagher
4f51153b09
Require latest yesod-core for yesod-test
...
(This was missing from #1646 )
2019-12-01 08:06:10 -05:00
Maximilian Tagher
3fac351583
Merge pull request #1646 from yesodweb/requireJSONResponse
...
[yesod-test] Adds requireJSONResponse function
2019-12-01 08:04:21 -05:00
Maximilian Tagher
8ee771896c
..
2019-11-29 10:46:25 -05:00
Maximilian Tagher
561adc2e17
..
2019-11-29 10:44:49 -05:00
Maximilian Tagher
42d41f77de
..
2019-11-29 10:43:11 -05:00
Maximilian Tagher
0025226af6
Print preview of JSON body in case of parse failure
2019-11-28 22:33:00 -05:00
Maximilian Tagher
91b75741dd
..
2019-11-24 16:11:50 -05:00
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
Michael Snoyman
463fd54c5a
Drop rio dep ( fixes #1645 )
2019-11-22 09:16:52 +02:00
Maximilian Tagher
d5f6fbba8b
Merge pull request #1642 from yesodweb/testModifySite
...
Add testModifySite
2019-11-20 08:41:08 -08: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
Michael Snoyman
0d4c435e42
Reenable yesod-auth on nightly
2019-11-16 21:18:18 +05:30
Michael Snoyman
bce08f6d86
Merge pull request #1640 from alexeyzab/mention-db-rollback
...
Add a warning about DB actions getting rolled back
2019-11-14 14:01:22 +05:30
Alexey Zabelin
19f4b26e1f
Add a warning about DB actions getting rolled back
2019-11-13 20:55:47 -08:00
Michael Snoyman
e333735176
Merge pull request #1638 from chrisdone/add-getting-started-code-sample
...
Add Getting Started to READMEs
2019-11-11 16:38:39 +02:00
Chris Done
4a6aedf88a
Add Getting Started to READMEs
...
* Adds to the README seen on Github.
* Adds to the README that will be seen on Stackage/Hackage.
2019-11-11 13:46:27 +01:00
Michael Snoyman
347ea6775b
Support for Cabal 3.0
2019-11-11 09:47:05 +02:00
Michael Snoyman
6d21107549
Merge pull request #1636 from yesodweb/1635-use-get-stmt-conn
...
Replace call to connPrepare with getStmtConn (fixes #1635 )
2019-10-30 05:49:01 +02:00
Michael Snoyman
7839de4dbd
Replace call to connPrepare with getStmtConn ( fixes #1635 )
2019-10-29 13:25:53 +02:00
Michael Snoyman
eb9432c01d
Simplify CI
2019-10-27 07:40:39 +02:00
Michael Snoyman
9b93e97a80
Merge pull request #1634 from betlgtu/master
...
Translated message "CurrentPassword" for russian language.
2019-10-27 07:35:29 +02:00
Виталий Котляров
ddc71e665b
Translated message "CurrentPassword" for russian language.
2019-10-26 23:08:38 +03:00
Michael Snoyman
b5fb6caca0
Merge branch 'master' of github.com:yesodweb/yesod
2019-10-10 06:44:12 +03:00
Michael Snoyman
5fb58470fe
Merge pull request #1632 from yesodweb/addBasicAuthToYesodTest
...
Add Basic Auth support to yesod-test
2019-10-10 06:44:00 +03:00
Michael Snoyman
b788310519
Not compatible with nightly right now
2019-10-10 06:43:51 +03: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
Michael Snoyman
c8aeb61ace
Merge pull request #1631 from yogsototh/rss-2.0
...
Support categories for Atom and RSS newsfeed
2019-10-02 13:37:54 +03:00
Yann Esposito (Yogsototh)
3a7bff1537
Feedback fixes
2019-10-02 09:07:55 +02:00
Yann Esposito (Yogsototh)
a0d35dfe4c
add support for RSS categories
2019-09-30 22:12:27 +02:00
Michael Snoyman
2a71af250f
Merge pull request #1628 from sestrella/areq_and_wreq_custom_error_message
...
Customize `areq` and `wreq` error message
2019-09-10 11:24:45 +03:00
Sebastián Estrella
32ecbd056d
Customize areq and wreq error message
2019-09-10 00:42:21 -05:00
Michael Snoyman
f054bac0e0
Version bump
2019-09-08 09:45:29 +03:00
Michael Snoyman
904644c577
Merge pull request #1627 from DanBurton/yesod-core-th-2-15-fix
...
Add new CPP branch for template-haskell >= 2.15
2019-09-08 08:58:27 +03:00
Dan Burton
ed69d69347
Add new CPP branch for template-haskell >= 2.15
2019-09-06 13:04:21 -04:00
Michael Snoyman
ba1e48308c
Merge pull request #1623 from jezen/master
...
Increase CI timeout
2019-08-27 14:54:46 +03:00
Jezen Thomas
d82baf83b6
Increase CI timeout
...
The build on Azure DevOps is currently failing as the build-time is
exceeding 120 minutes. Hopefully 180 minutes should be sufficient.
2019-08-27 12:19:29 +02:00
Michael Snoyman
50a3242507
Merge pull request #1622 from jezen/master
...
Add jsAttributesHandler
2019-08-26 16:25:46 +03:00
Jezen Thomas
46af7bfb76
Cleanup
2019-08-26 13:49:57 +02:00
Jezen Thomas
d1e4fd485b
Make jsAttributesHandler use jsAttributes
...
This addresses this comment:
https://github.com/yesodweb/yesod/pull/1622#discussion_r317467498
2019-08-26 12:05:30 +02:00