mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Assert that Last-Modified is set
This commit is contained in:
parent
f8a43f0996
commit
15719a798c
1 changed files with 3 additions and 0 deletions
|
|
@ -286,9 +286,11 @@
|
|||
(testing "different file-types"
|
||||
(let [response (app {:uri "/files/hello.json", :request-method :get})]
|
||||
(is (= "application/json" (get-in response [:headers "Content-Type"])))
|
||||
(is (get-in response [:headers "Last-Modified"]))
|
||||
(is (= "{\"hello\": \"file\"}" (slurp (:body response)))))
|
||||
(let [response (app {:uri "/files/hello.xml", :request-method :get})]
|
||||
(is (= "text/xml" (get-in response [:headers "Content-Type"])))
|
||||
(is (get-in response [:headers "Last-Modified"]))
|
||||
(is (= "<xml><hello>file</hello></xml>\n" (slurp (:body response))))))
|
||||
|
||||
(testing "not found"
|
||||
|
|
@ -301,4 +303,5 @@
|
|||
raise ::not-called]
|
||||
(app {:uri "/files/hello.xml", :request-method :get} respond raise)
|
||||
(is (= "text/xml" (get-in @result [:headers "Content-Type"])))
|
||||
(is (get-in @result [:headers "Last-Modified"]))
|
||||
(is (= "<xml><hello>file</hello></xml>\n" (slurp (:body @result))))))))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue