|
5 | 5 |
|
6 | 6 | (deftest raw-HTML
|
7 | 7 | (testing "Raw HTML simple"
|
8 |
| - (is (= (templates/raw-HTML {:req "test"} "<html><body></body></html>" {}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<html><body></body></html>", :session nil}))) |
| 8 | + (is (= (templates/raw-HTML {:req "test"} "<html><body></body></html>" {}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body></body></html>", :session nil}))) |
9 | 9 | (testing "Raw HTML with param"
|
10 |
| - (is (= (templates/raw-HTML {:req "test"} "<html><body>{{ hello }}</body></html>" {:hello "world"}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<html><body>world</body></html>", :session nil})))) |
| 10 | + (is (= (templates/raw-HTML {:req "test"} "<html><body>{{ hello }}</body></html>" {:hello "world"}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body>world</body></html>", :session nil})))) |
11 | 11 |
|
12 | 12 | (deftest render-HTML
|
13 | 13 | (testing "Simple"
|
14 |
| - (is (= (templates/render-HTML {:req "test"} (resource "html/simple.html") {}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil}))) |
| 14 | + (is (= (templates/render-HTML {:req "test"} (resource "html/simple.html") {}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil}))) |
15 | 15 | (testing "With param"
|
16 |
| - (is (= (templates/render-HTML {:req "test"} (resource "html/with-param.html") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil})))) |
| 16 | + (is (= (templates/render-HTML {:req "test"} (resource "html/with-param.html") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil})))) |
17 | 17 |
|
18 | 18 | (deftest render-404
|
19 | 19 | (testing "Simple"
|
20 |
| - (is (= (templates/render-404 {:req "test"} (resource "html/simple.html") {}) {:status 404, :headers {"Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil}))) |
| 20 | + (is (= (templates/render-404 {:req "test"} (resource "html/simple.html") {}) {:status 404, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil}))) |
21 | 21 | (testing "With param"
|
22 |
| - (is (= (templates/render-404 {:req "test"} (resource "html/with-param.html") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 404, :headers {"Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil})))) |
| 22 | + (is (= (templates/render-404 {:req "test"} (resource "html/with-param.html") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 404, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<html><body><h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p></body></html>\n", :session nil})))) |
23 | 23 |
|
24 | 24 | (deftest render-markdown
|
25 | 25 | (testing "Simple"
|
26 |
| - (is (= (templates/render-markdown {:req "test"} (resource "markdown/simple.md") {}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<h1>Title</h1><p>Hello <strong>world</strong></p>", :session nil}))) |
| 26 | + (is (= (templates/render-markdown {:req "test"} (resource "markdown/simple.md") {}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<h1>Title</h1><p>Hello <strong>world</strong></p>", :session nil}))) |
27 | 27 | (testing "With param"
|
28 |
| - (is (= (templates/render-markdown {:req "test"} (resource "markdown/with-param.md") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 200, :headers {"Content-Type" "text/html"}, :body "<h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p>", :session nil})))) |
| 28 | + (is (= (templates/render-markdown {:req "test"} (resource "markdown/with-param.md") {:rating "Awesome" :url "https://tadam-framework.dev"}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "text/html"}, :body "<h1>Title</h1><p>Tadam is Awesome</p><p><a href='https://tadam-framework.dev'>Website</a></p>", :session nil})))) |
29 | 29 |
|
30 | 30 | (deftest render-json
|
31 | 31 | (testing "Simple"
|
32 |
| - (is (= (templates/render-JSON {:req "test"} {:name "Tadam" :type "Framework"}) {:status 200, :headers {"Content-Type" "application/json"}, :body "{\"name\":\"Tadam\",\"type\":\"Framework\"}", :session nil})))) |
| 32 | + (is (= (templates/render-JSON {:req "test"} {:name "Tadam" :type "Framework"}) {:status 200, :headers {"X-Powered-By" "Clojure/Tadam", "Content-Type" "application/json"}, :body "{\"name\":\"Tadam\",\"type\":\"Framework\"}", :session nil})))) |
0 commit comments