diff options
Diffstat (limited to 'compojure-3.2/test/compojure/http/helpers_test.clj')
| -rwxr-xr-x | compojure-3.2/test/compojure/http/helpers_test.clj | 21 |
1 files changed, 21 insertions, 0 deletions
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"))) |
