Skip to content

Commit

Permalink
Fix: account for changed malli encoder behavior that was breaking rin…
Browse files Browse the repository at this point in the history
…g-coercion-test
  • Loading branch information
Martín Varela committed Feb 9, 2024
1 parent f99a768 commit 982ac3e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/cljc/reitit/ring_coercion_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 982ac3e

Please sign in to comment.