Added a boilerplate luminus project
+re-frame +swagger +oauth - probably this is massive overkill
This commit is contained in:
parent
94abf7aae8
commit
bad860f78e
42 changed files with 1132 additions and 0 deletions
26
test/clj/ireadit/test/handler.clj
Normal file
26
test/clj/ireadit/test/handler.clj
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(ns ireadit.test.handler
|
||||
(:require [clojure.test :refer :all]
|
||||
[ring.mock.request :refer :all]
|
||||
[ireadit.handler :refer :all]
|
||||
[ireadit.middleware.formats :as formats]
|
||||
[muuntaja.core :as m]
|
||||
[mount.core :as mount]))
|
||||
|
||||
(defn parse-json [body]
|
||||
(m/decode formats/instance "application/json" body))
|
||||
|
||||
(use-fixtures
|
||||
:once
|
||||
(fn [f]
|
||||
(mount/start #'ireadit.config/env
|
||||
#'ireadit.handler/app)
|
||||
(f)))
|
||||
|
||||
(deftest test-app
|
||||
(testing "main route"
|
||||
(let [response (app (request :get "/"))]
|
||||
(is (= 200 (:status response)))))
|
||||
|
||||
(testing "not-found route"
|
||||
(let [response (app (request :get "/invalid"))]
|
||||
(is (= 404 (:status response))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue