+11
-3
@@ -12,13 +12,21 @@
|
||||
(handler {:request-method method :uri uri :headers {}}))
|
||||
|
||||
(deftest root-test
|
||||
(let [resp (request :get "/")]
|
||||
(let [resp (request :get "/")
|
||||
body (slurp (:body resp))]
|
||||
(is (= 200 (:status resp)))
|
||||
(is (= "text/plain; charset=utf-8" (get-in resp [:headers "Content-Type"])))
|
||||
(is (re-find #"/api-docs" (:body resp))))
|
||||
(is (= "text/html; charset=utf-8" (get-in resp [:headers "Content-Type"])))
|
||||
(testing "serves the HTML shell that mounts the re-frame UI"
|
||||
(is (re-find #"<div id=\"app\"" body))
|
||||
(is (re-find #"<script src=\"/js/main\.js\"" body))))
|
||||
(testing "HEAD is served like GET, without a body"
|
||||
(is (= 200 (:status (request :head "/"))))))
|
||||
|
||||
(deftest js-assets-test
|
||||
;; main.js only exists once script/ui-build has run, so only the miss is asserted here;
|
||||
;; the integration suite (which runs against the built image) checks the hit.
|
||||
(is (= 404 (:status (request :get "/js/nope.js")))))
|
||||
|
||||
(deftest swagger-spec-test
|
||||
(let [resp (request :get "/swagger.json")]
|
||||
(is (= 200 (:status resp)))
|
||||
|
||||
Reference in New Issue
Block a user