mirror of
https://github.com/metosin/reitit.git
synced 2026-02-17 08:15:56 +00:00
testing assertion
This commit is contained in:
parent
5e3e552c80
commit
029894b984
2 changed files with 7 additions and 1 deletions
|
|
@ -100,7 +100,9 @@
|
||||||
::default-options-endpoint default-options-endpoint}
|
::default-options-endpoint default-options-endpoint}
|
||||||
opts)]
|
opts)]
|
||||||
(assert (not (contains? opts ::default-options-handler))
|
(assert (not (contains? opts ::default-options-handler))
|
||||||
"Option `::default-options-handler` is deprecated. Use `::default-options-endpoint` instead.")
|
(str
|
||||||
|
"Option `:reitit.ring/default-options-handler` is deprecated."
|
||||||
|
" Use `:reitit.ring/default-options-endpoint` instead."))
|
||||||
(r/router data opts))))
|
(r/router data opts))))
|
||||||
|
|
||||||
(defn routes
|
(defn routes
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,10 @@
|
||||||
(is (= 405 (:status (app {:request-method :post, :uri "/ping"}))))))))))
|
(is (= 405 (:status (app {:request-method :post, :uri "/ping"}))))))))))
|
||||||
|
|
||||||
(deftest default-options-handler-test
|
(deftest default-options-handler-test
|
||||||
|
(testing "Assertion fails when using deprecated options-handler"
|
||||||
|
(is (thrown? java.lang.AssertionError (ring/router [] {::ring/default-options-handler (fn [_] )})))))
|
||||||
|
|
||||||
|
(deftest default-options-endpoint-test
|
||||||
(let [response {:status 200, :body "ok"}]
|
(let [response {:status 200, :body "ok"}]
|
||||||
|
|
||||||
(testing "with defaults"
|
(testing "with defaults"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue