git.iko.soy/servant-quickcheck
on master help sign in
Add references
commit6e727b6d33b3a3595eab1245ac23c50bea1e1a11 authorJulian K. Arni <jkarni@gmail.com> dateSat 23 Apr 2016, 22:46 (11 years ago) parent76e3b8e
1 file changed+9
src/Servant/QuickCheck/Internal/Predicates.hs+9
src/Servant/QuickCheck/Internal/Predicates.hs+9
@@ -36,6 +36,11 @@ not500 = ResponsePredicate "not500" (\resp -> not $ responseStatus resp == statu
3636--
3737-- This function checks that any @application/json@ responses only return JSON
3838-- objects (and not arrays, strings, numbers, or booleans) at the top level.
39+--
40+-- __References__:
41+--
42+-- * JSON Grammar: <https://tools.ietf.org/html/rfc7159#section-2 RFC 7159 Section 2>
43+-- * JSON Grammar: <https://tools.ietf.org/html/rfc4627#section-2 RFC 4627 Section 2>
3944onlyJsonObjects :: ResponsePredicate Text Bool
4045onlyJsonObjects
4146 = ResponsePredicate "onlyJsonObjects" (\resp -> case decode (responseBody resp) of
@@ -66,6 +71,10 @@ getsHaveLastModifiedHeader
6671--
6772-- This function checks that every @405 Method Not Allowed@ response contains
6873-- an @Allow@ header with a list of standard HTTP methods.
74+--
75+-- __References__:
76+--
77+-- * @Allow@ header: <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html RFC 2616 Section 14.7>
6978notAllowedContainsAllowHeader :: ResponsePredicate Text Bool
7079notAllowedContainsAllowHeader
7180 = ResponsePredicate "notAllowedContainsAllowHeader" (\resp ->