test: add test for overriding malli registry

This commit is contained in:
Joel Kaasinen 2025-11-14 14:05:36 +02:00
parent ea58100fec
commit af7313bd9b
No known key found for this signature in database

View file

@ -585,7 +585,7 @@
(is (= {:status 200, :body {:total "FOO: this, BAR: that"}} (call m/schema custom-meta-merge-checking-schema)))
(is (= {:status 200, :body {:total "FOO: this, BAR: that"}} (call identity custom-meta-merge-checking-parameters)))))
(testing "options"
(testing "malli options"
(let [->app (fn [options]
(ring/ring-handler
(ring/router
@ -593,7 +593,7 @@
[:i :int]
[:x :string]]}
:handler (fn [{{:keys [body]} :parameters}]
{:status 200 :body {}})}}]
{:status 200 :body body})}}]
{:data {:middleware [rrc/coerce-exceptions-middleware
rrc/coerce-request-middleware
rrc/coerce-response-middleware]
@ -611,7 +611,12 @@
:malli.core/missing-key {:error/message {:en "MISSING"}}}}})
(assoc request :body-params {:i "x"}))
:body
:humanized))))))))
:humanized))))
(testing "overriding registry"
(is (= {:body {:i "x" :x "x"} :status 200}
(-> ((->app {:options {:registry (merge (m/default-schemas)
{:int :string})}})
(assoc request :body-params {:i "x" :x "x"}))))))))))
#?(:clj
(deftest per-content-type-test