1 | cc = require '../lib/coffeecup'
|
2 |
|
3 | describe 'doctype', ->
|
4 | it 'default should render html5 doctype', ->
|
5 | template = "doctype()"
|
6 | expected = '<!DOCTYPE html>'
|
7 | cc.render(template).should.equal expected
|
8 | it 'xml should render xml header', ->
|
9 | template = "doctype 'xml'"
|
10 | expected = '<?xml version="1.0" encoding="utf-8" ?>'
|
11 | cc.render(template).should.equal expected
|
12 | it '5 should render html 5 doctype', ->
|
13 | template = "doctype 5"
|
14 | expected = '<!DOCTYPE html>'
|
15 | cc.render(template).should.equal expected
|
16 | it 'transitional should render transitional doctype', ->
|
17 | template = "doctype 'transitional'"
|
18 | expected = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
|
19 | cc.render(template).should.equal expected
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | describe 'doctype optimized', ->
|
29 | it 'default should render html5 doctype', ->
|
30 | template = "doctype()"
|
31 | expected = '<!DOCTYPE html>'
|
32 | cc.render(template, optimized: true, cache: on).should.equal expected
|
33 | it 'xml should render xml header', ->
|
34 | template = "doctype 'xml'"
|
35 | expected = '<?xml version="1.0" encoding="utf-8" ?>'
|
36 | cc.render(template, optimized: true, cache: on).should.equal expected
|
37 | it '5 should render html 5 doctype', ->
|
38 | template = "doctype 5"
|
39 | expected = '<!DOCTYPE html>'
|
40 | cc.render(template, optimized: true, cache: on).should.equal expected
|
41 | it 'transitional should render transitional doctype', ->
|
42 | template = "doctype 'transitional'"
|
43 | expected = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
|
44 | cc.render(template, optimized: true, cache: on).should.equal expected
|