Browse Source

Safer mount management

master
Stephen Starkey 2 years ago
parent
commit
7f3f978063
  1. 7
      test/clj/email_counter/test/handler.clj

7
test/clj/email_counter/test/handler.clj

@ -13,8 +13,7 @@
(fn [f]
(mount/start #'email-counter.config/env
#'email-counter.handler/app-routes)
(f)
(mount/stop)))
(try (f) (finally (mount/stop)))))
(defn decode-response-body [{{:strs [Content-Type]} :headers :as response}]
(case (first (str/split Content-Type #";"))
@ -50,8 +49,8 @@
(with-redefs [exception/log-error
(fn [e] (swap! exceptions-encountered conj e))]
(testing "ping"
(is (= {:status 200, :body {:message "pong"}}
(clean-response ((app) (request :get "/api/ping"))))))
(is (= {:status 200, :body {:message "pong"}}
(clean-response ((app) (request :get "/api/ping"))))))
(testing "emailcount"
(is (= {:status 200, :body {:total 2}}

Loading…
Cancel
Save