From d3fcf8d56122514c3dcbac004fcf105a4e899352 Mon Sep 17 00:00:00 2001 From: sostler Date: Wed, 10 Feb 2010 01:08:44 -0500 Subject: Added custom compojure tree --- compojure-3.2/test/compojure/http/helpers_test.clj | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 compojure-3.2/test/compojure/http/helpers_test.clj (limited to 'compojure-3.2/test/compojure/http/helpers_test.clj') diff --git a/compojure-3.2/test/compojure/http/helpers_test.clj b/compojure-3.2/test/compojure/http/helpers_test.clj new file mode 100755 index 0000000..fdd9a68 --- /dev/null +++ b/compojure-3.2/test/compojure/http/helpers_test.clj @@ -0,0 +1,21 @@ +(ns compojure.http.helpers-test + (:use compojure.http.helpers + compojure.http.routes + compojure.control + clojure.contrib.test-is)) + +(deftest test-set-cookie + (is (= (set-cookie :foo "bar") + {:headers {"Set-Cookie" "foo=bar"}}))) + +(deftest test-set-cookie-path + (is (= (set-cookie :a "b", :path "/") + {:headers {"Set-Cookie" "a=b; path=/"}}))) + +(deftest test-content-type + (is (= (content-type "text/html") + {:headers {"Content-Type" "text/html"}}))) + +(deftest test-safe-path + (is (not (safe-path? "/basedir/compojure" "../private/secret.txt"))) + (is (safe-path? "/basedir/compojure" "public/index.html"))) -- cgit v1.2.3-70-g09d2