summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-21 11:28:55 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-21 11:28:55 +0100
commitca1313e891f7cfbdffaf6a47bb75a8bc1d77c1a4 (patch)
treec121c0ead1b515145e5e563ce1c48ff293b59a6f /test
parent8df18746face0bf43d18540d3de5ac0cdd795549 (diff)
downloadgitbook-ca1313e891f7cfbdffaf6a47bb75a8bc1d77c1a4.zip
gitbook-ca1313e891f7cfbdffaf6a47bb75a8bc1d77c1a4.tar.gz
gitbook-ca1313e891f7cfbdffaf6a47bb75a8bc1d77c1a4.tar.bz2
Extend configuration with infos from readme
Diffstat (limited to 'test')
-rw-r--r--test/page.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/page.js b/test/page.js
index 9afec1c..8eb2096 100644
--- a/test/page.js
+++ b/test/page.js
@@ -6,6 +6,7 @@ describe('Page', function() {
before(function() {
return mock.setupDefaultBook({
+ 'README.md': ' # Hello World\n\nThis is a description',
'heading.md': '# Hello\n\n## World',
'links.md': '[link](hello.md) [link 2](variables/page/next.md) [readme](README.md)',
@@ -31,6 +32,7 @@ describe('Page', function() {
'variables/page/next.md': '{{ page.next.title }} {{ page.next.path }}',
'variables/page/dir/ltr.md': 'This is english: {{ page.dir }}',
'variables/page/dir/rtl.md': 'بسيطة {{ page.dir }}',
+ 'variables/book/title.md': '{{ book.title}}',
'GLOSSARY.md': '# Glossary\n\n\n## abracadabra\n\nthis is the description'
}, [
@@ -315,6 +317,12 @@ describe('Page', function() {
.should.be.fulfilledWith('<p>Test Variables variables/page/title.md</p>\n');
});
+ it('should set book.title', function() {
+ var page = book.addPage('variables/book/title.md');
+ return page.toHTML(output)
+ .should.be.fulfilledWith('<p>Hello World</p>\n');
+ });
+
describe('page.dir', function() {
it('should detect ltr', function() {
var page = book.addPage('variables/page/dir/ltr.md');