File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 107107 {:status 200 :body " delete-with-body" }
108108 [:post " /multipart" ]
109109 {:status 200 :body (:body req)}
110- [:head " /head-with-body" ]
111- {:status 200 :headers {" body" (slurp (:body req))}}
112110 [:get " /get-with-body" ]
113111 {:status 200 :body (:body req)}
114112 [:options " /options" ]
150148 (defonce ^org.eclipse.jetty.server.Server server
151149 (ring/run-jetty (add-headers-if-requested #'handler) {:port 18080 :join? false })))
152150
153- (defn restart-server
154- []
155- (.stop server)
156- (.start server))
157-
158151(defn localhost [path]
159152 (str " http://localhost:18080" path))
160153
166159(defn slurp-body [req]
167160 (slurp (:body req)))
168161
169-
170162(deftest ^:integration makes-get-request
171163 (run-server )
172164 (let [resp (request {:request-method :get :uri " /get" })]
422414
423415(deftest ^:integration head-with-body
424416 (run-server )
425- (let [resp (request {:request-method :head :uri " /head-with-body"
426- :body (.getBytes " foo" )})]
427- (is (= 200 (:status resp)))
428- (is (= " foo" (get-in resp [:headers " body" ])))))
417+ (let [resp (request {:request-method :head :uri " /head" :body " foo" })]
418+ (is (= 200 (:status resp)))))
429419
430420(deftest ^:integration t-clojure-output-coercion
431421 (run-server )
You can’t perform that action at this time.
0 commit comments