aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/clj/queue_api/test/handler.clj21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/clj/queue_api/test/handler.clj b/test/clj/queue_api/test/handler.clj
new file mode 100644
index 0000000..1aceb3c
--- /dev/null
+++ b/test/clj/queue_api/test/handler.clj
@@ -0,0 +1,21 @@
+(ns queue-api.test.handler
+ (:require [clojure.test :refer :all]
+ [ring.mock.request :refer :all]
+ [queue-api.handler :refer :all]
+ [mount.core :as mount]))
+
+(use-fixtures
+ :once
+ (fn [f]
+ (mount/start #'queue-api.config/env
+ #'queue-api.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))))))