This commit is contained in:
Rüdiger Diedrich
2020-06-05 20:28:33 +02:00
commit 2984b4911e
5 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,14 @@
(ns clojsa.handler-test
(:require [clojure.test :refer :all]
[ring.mock.request :as mock]
[clojsa.handler :refer :all]))
(deftest test-app
(testing "main route"
(let [response (app (mock/request :get "/"))]
(is (= (:status response) 200))
(is (= (:body response) "Hello World"))))
(testing "not-found route"
(let [response (app (mock/request :get "/invalid"))]
(is (= (:status response) 404)))))