This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-30
Channels
- # arachne (5)
- # beginners (42)
- # cider (35)
- # cljs-dev (25)
- # cljsrn (2)
- # clojure (107)
- # clojure-dev (32)
- # clojure-finland (2)
- # clojure-greece (3)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-spec (27)
- # clojure-uk (45)
- # clojurescript (152)
- # core-async (3)
- # cursive (26)
- # data-science (4)
- # datomic (33)
- # defnpodcast (1)
- # duct (12)
- # editors (3)
- # emacs (6)
- # events (5)
- # fulcro (6)
- # jobs (1)
- # lein-figwheel (9)
- # off-topic (7)
- # onyx (7)
- # re-frame (1)
- # reagent (9)
- # reitit (31)
- # shadow-cljs (130)
- # slack-help (1)
- # spacemacs (53)
- # tools-deps (55)
- # yada (4)
I've been trying to use response-for to test a POST resource. When I specify :form
for parameters in the resource, the test works but it doesn't work if I specify :body
.
My resource definition looks like:
(yada/resource
{:methods
:post {:parameters {:form {s/Keyword s/Any}}
:consumes "application/json"
:produces "application/json"
:response (post-user-settings-response-fn user-settings-storage)}}})
A test looks like:
(is (= 200
(-> (response-for resource :post "/"
{:headers {"Content-Type" "application/json"}
:body (.getBytes (json/encode expected-settings))})
:status)))
However, this test is failing because I'm getting a 400 saying that the resource expects a body