This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-08
Channels
- # bangalore-clj (5)
- # beginners (6)
- # boot (66)
- # cider (48)
- # cljsrn (14)
- # clojure (699)
- # clojure-austin (2)
- # clojure-berlin (1)
- # clojure-boston (5)
- # clojure-dev (3)
- # clojure-india (7)
- # clojure-italy (24)
- # clojure-nl (5)
- # clojure-russia (33)
- # clojure-spec (30)
- # clojure-uk (64)
- # clojure-ukraine (22)
- # clojurescript (123)
- # clojurewest (1)
- # cursive (18)
- # datascript (44)
- # datomic (12)
- # dirac (46)
- # figwheel (1)
- # gsoc (5)
- # hoplon (6)
- # immutant (29)
- # instaparse (1)
- # juxt (26)
- # lein-figwheel (5)
- # leiningen (4)
- # luminus (8)
- # mount (56)
- # off-topic (60)
- # om (67)
- # om-next (1)
- # onyx (8)
- # proton (28)
- # re-frame (125)
- # ring (3)
- # ring-swagger (3)
- # specter (22)
- # testing (2)
- # unrepl (1)
- # untangled (91)
hello, how do you get the query parameter's value using ring.mock.request? for example, I have this resource route:
(defroutes app
(ANY "/" []
(resource :available-media-types ["text/html"]
:exists? (fn [context]
(= "wooji" (get-in context [:request :params "dog"])))
:handle-ok "You found a treasure!"
:handle-not-found "Nope! That's not the treasure")))
and here's the test:
(facts "about GET /?dog=wooji"
(let [response (app (request :get "/" {:dog "wooji"}))]
(fact "body: You found a treasure"
(:body response) => "You found a treasure!"))))
But it doesn't seem to work,
the app handler is using the wrap-params
(which I think is required to correct ring.mock.request
capturing of parameters:
(def handler
(-> app
wrap-params))