Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed route/resource for Ring 0.3.0

  • Loading branch information...
commit 1e78dcce8a4064f7033b57a430794149f84a7112 1 parent 5e3543f
@weavejester authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/compojure/route.clj
  2. +2 −2 test/compojure/test/route.clj
View
4 src/compojure/route.clj
@@ -20,10 +20,10 @@
(defn resources
"A route for serving resources on the classpath. Accepts the following
keys:
- :root - the root prefix to get the resources from. Defaults to 'public'."
+ :root - the root prefix to get the resources from. Defaults to '/public'."
[path & [options]]
(GET (add-wildcard path) {{resource-path "*"} :params}
- (let [options (merge {:root "public"} options)]
+ (let [options (merge {:root "/public"} options)]
(resource-response resource-path options))))
(defn not-found
View
4 test/compojure/test/route.clj
@@ -1,6 +1,6 @@
(ns compojure.test.route
(:use clojure.test
- [clojure.contrib.duck-streams :only (slurp*)])
+ [clojure.contrib.io :only (slurp*)])
(:require [compojure.route :as route]))
(deftest not-found-route
@@ -9,7 +9,7 @@
(is (= (:body response) "foo"))))
(deftest resources-route
- (let [route (route/resources "/foo" {:root "resources"})
+ (let [route (route/resources "/foo" {:root "/resources"})
response (route {:request-method :get, :uri "/foo/test.txt"})]
(is (= (:status response) 200))
(is (= (slurp* (:body response)) "foobar\n"))))
Please sign in to comment.
Something went wrong with that request. Please try again.