diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f344f4e..4fc254f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ We use [Break Versioning][breakver]. The version numbers follow a `. request :path-params parameter)] (or (path-or-index-response path uri) (not-found-handler request)))))] diff --git a/test/cljc/reitit/ring_test.cljc b/test/cljc/reitit/ring_test.cljc index 52dd938b..b057b401 100644 --- a/test/cljc/reitit/ring_test.cljc +++ b/test/cljc/reitit/ring_test.cljc @@ -471,9 +471,9 @@ (testing "from root" (let [app (ring/ring-handler - (ring/router - ["/*" (create nil)]) - (ring/create-default-handler))] + (ring/router + ["/*" (create nil)]) + (ring/create-default-handler))] (testing "different file-types" (let [response (app (request "/hello.json"))] (is (= "application/json" (get-in response [:headers "Content-Type"]))) @@ -484,6 +484,11 @@ (is (get-in response [:headers "Last-Modified"])) (is (= "file\n" (slurp (:body response)))))) + (testing "with url decoding" + (let [response (app (request "/with%20space.txt"))] + (is (= 200 (:status response))) + (is (= "hello\n" (slurp (:body response)))))) + (testing "index-files" (let [response (app (request "/docs"))] (is (= (redirect "/docs/index.html") response))) @@ -520,6 +525,11 @@ (is (get-in response [:headers "Last-Modified"])) (is (= "file\n" (slurp (:body response)))))) + (testing "with url decoding" + (let [response (app (request "/with%20space.txt"))] + (is (= 200 (:status response))) + (is (= "hello\n" (slurp (:body response)))))) + (testing "index-files" (let [response (app (request "/docs"))] (is (= (redirect "/docs/index.html") response))) @@ -557,6 +567,11 @@ (is (get-in response [:headers "Last-Modified"])) (is (= "file\n" (slurp (:body response)))))) + (testing "with url decoding" + (let [response (app (request "/with%20space.txt"))] + (is (= 200 (:status response))) + (is (= "hello\n" (slurp (:body response)))))) + (testing "index-files" (let [response (app (request "/docs"))] (is (= (redirect "/docs/index.html") response))) @@ -595,6 +610,11 @@ (is (get-in response [:headers "Last-Modified"])) (is (= "file\n" (slurp (:body response)))))) + (testing "with url decoding" + (let [response (app (request "/with%20space.txt"))] + (is (= 200 (:status response))) + (is (= "hello\n" (slurp (:body response)))))) + (testing "index-files" (let [response (app (request "/docs"))] (is (= (redirect "/docs/index.html") response)))