Skip to content

Commit cb36033

Browse files
committed
extending page_helpers_test
1 parent f5b3099 commit cb36033

1 file changed

Lines changed: 31 additions & 21 deletions

File tree

test/compojure/html/page_helpers_test.clj

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,46 @@
22
(:use compojure.html.page-helpers
33
clojure.contrib.test-is))
44

5-
(deftest test-doctype-html4
6-
(is (= (doctype :html4)
7-
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
8-
"\"http://www.w3.org/TR/html4/strict.dtd\">\n"))))
9-
10-
(deftest test-doctype-xhtml-strict
11-
(is (= (doctype :xhtml-strict)
12-
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" "
5+
(deftest test-doctype
6+
(testing "html4"
7+
(is (= (doctype :html4)
8+
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
9+
"\"http://www.w3.org/TR/html4/strict.dtd\">\n"))))
10+
(testing "xhtml-strict"
11+
(is (= (doctype :xhtml-strict)
12+
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" "
1313
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"))))
14-
15-
(deftest test-doctype-html5
16-
(is (= (doctype :html5)
17-
(str "<!DOCTYPE html>"))))
18-
19-
(deftest test-doctype-xhtml-transitional
20-
(is (= (doctype :xhtml-transitional)
21-
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
22-
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"))))
14+
(testing "html5"
15+
(is (= (doctype :html5)
16+
(str "<!DOCTYPE html>"))))
17+
(testing "xhtml-transitional"
18+
(is (= (doctype :xhtml-transitional)
19+
(str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
20+
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n")))))
2321

2422
(deftest test-xhtml-tag
2523
(is (= (xhtml-tag "test")
2624
[:html {:xmlns "http://www.w3.org/1999/xhtml", "xml:lang" "test", :lang "test"} nil])))
2725

2826
(deftest test-include-js
29-
(is (= (include-js "foo.js")
30-
'([:script {:type "text/javascript", :src "foo.js"}]))))
27+
(testing "one"
28+
(is (= (include-js "foo.js")
29+
'([:script {:type "text/javascript", :src "foo.js"}]))))
30+
(testing "many"
31+
(is (= (include-js "foo.js" "bar.js" "baz.js")
32+
'([:script {:type "text/javascript", :src "foo.js"}]
33+
[:script {:type "text/javascript", :src "bar.js"}]
34+
[:script {:type "text/javascript", :src "baz.js"}])))))
3135

3236
(deftest test-include-css
33-
(is (= (include-css "foo.css")
34-
'([:link {:type "text/css" :href "foo.css" :rel "stylesheet"}]))))
37+
(testing "one"
38+
(is (= (include-css "foo.css")
39+
'([:link {:type "text/css" :href "foo.css" :rel "stylesheet"}]))))
40+
(testing "many"
41+
(is (= (include-css "foo.css" "bar.css" "baz.css")
42+
'([:link {:type "text/css", :href "foo.css", :rel "stylesheet"}]
43+
[:link {:type "text/css", :href "bar.css", :rel "stylesheet"}]
44+
[:link {:type "text/css", :href "baz.css", :rel "stylesheet"}])))))
3545

3646
(deftest test-javascript-tag
3747
(is (= (javascript-tag "alert('hi');")

0 commit comments

Comments
 (0)