mirror of
https://github.com/metosin/reitit.git
synced 2026-01-23 06:39:03 +00:00
Test all working paths with static-handlers
This commit is contained in:
parent
49e8d273ac
commit
e295861fe5
1 changed files with 5 additions and 1 deletions
|
|
@ -284,7 +284,7 @@
|
||||||
(ring/create-resource-handler {:path "/files"})
|
(ring/create-resource-handler {:path "/files"})
|
||||||
(ring/create-resource-handler {:path "/"})
|
(ring/create-resource-handler {:path "/"})
|
||||||
(ring/create-default-handler)))]]
|
(ring/create-default-handler)))]]
|
||||||
prefix ["/" "/files"]
|
prefix ["" "/" "/files" "/files/"]
|
||||||
:let [request (fn [uri] {:uri (str prefix uri), :request-method :get})]]
|
:let [request (fn [uri] {:uri (str prefix uri), :request-method :get})]]
|
||||||
|
|
||||||
(testing test
|
(testing test
|
||||||
|
|
@ -300,6 +300,10 @@
|
||||||
|
|
||||||
(testing "index-files"
|
(testing "index-files"
|
||||||
(let [response (app (request "/docs"))]
|
(let [response (app (request "/docs"))]
|
||||||
|
(is (= "text/html" (get-in response [:headers "Content-Type"])))
|
||||||
|
(is (get-in response [:headers "Last-Modified"]))
|
||||||
|
(is (= "<h1>hello</h1>\n" (slurp (:body response)))))
|
||||||
|
(let [response (app (request "/docs/"))]
|
||||||
(is (= "text/html" (get-in response [:headers "Content-Type"])))
|
(is (= "text/html" (get-in response [:headers "Content-Type"])))
|
||||||
(is (get-in response [:headers "Last-Modified"]))
|
(is (get-in response [:headers "Last-Modified"]))
|
||||||
(is (= "<h1>hello</h1>\n" (slurp (:body response))))))
|
(is (= "<h1>hello</h1>\n" (slurp (:body response))))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue