From 982ac3ec72ad52e4da7aa7b2dca10428a813d221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Varela?= Date: Fri, 9 Feb 2024 11:37:34 +0200 Subject: [PATCH] Fix: account for changed malli encoder behavior that was breaking ring-coercion-test --- test/cljc/reitit/ring_coercion_test.cljc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/cljc/reitit/ring_coercion_test.cljc b/test/cljc/reitit/ring_coercion_test.cljc index ec2bd1fe..0a1c6503 100644 --- a/test/cljc/reitit/ring_coercion_test.cljc +++ b/test/cljc/reitit/ring_coercion_test.cljc @@ -652,12 +652,14 @@ :uri "/foo" :muuntaja/request {:format request-format} :muuntaja/response {:format response-format} - :body-params body})] + :body-params body}) + normalize-json (fn[body] + (-> body j/write-value-as-string (j/read-value j/keyword-keys-object-mapper)))] (testing "succesful call" - (is (= {:status 200 :body {:request :json, :response :json}} - (call (request "application/json" "application/json" {:request :json :response :json})))) - (is (= {:status 200 :body {:request :edn, :response :json}} - (call (request "application/edn" "application/json" {:request :edn :response :json})))) + (is (= {:status 200 :body {:request "json", :response "json"}} + (normalize-json (call (request "application/json" "application/json" {:request :json :response :json}))))) + (is (= {:status 200 :body {:request "edn", :response "json"}} + (normalize-json (call (request "application/edn" "application/json" {:request :edn :response :json}))))) (is (= {:status 200 :body {:request :default, :response :default}} (call (request "application/transit" "application/transit" {:request :default :response :default}))))) (testing "request validation fails"