Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Sep 12, 2010
1 parent cd6876b commit 583236e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/compojure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(if-let [route-params# (route-matches route# request#)]
(let [request# (#'assoc-route-params request# route-params#)]
(bind-request request# ~bindings
(render request# (do ~@body)))))))))
(render (do ~@body) request#))))))))

(defn routes
"Create a Ring handler by combining several handlers into one."
Expand Down
8 changes: 4 additions & 4 deletions test/compojure/test/response.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
(:require [compojure.response :as response]))

(deftest response-with-nil
(is (nil? (response/render {} nil))))
(is (nil? (response/render nil {}))))

(def test-response
{:status 200
:headers {"Content-Type" "text/html"}
:body "<h1>Foo</h1>"})

(deftest response-with-string
(is (= (response/render {} "<h1>Foo</h1>")
(is (= (response/render "<h1>Foo</h1>" {})
test-response)))

(deftest response-with-fn
(is (= (response/render {} (constantly test-response))
(is (= (response/render (constantly test-response) {})
test-response)))

(deftest response-with-deref
(is (= (response/render {} (future test-response))
(is (= (response/render (future test-response) {})
test-response)))

0 comments on commit 583236e

Please sign in to comment.