diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-17 17:38:39 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-17 17:38:39 +0100 |
commit | 2b5e836a3329917f1af4c0de51974b672994ec4b (patch) | |
tree | 9cd0dadfaef82bdcf1a06b3267f1783061492c7d /test | |
parent | 9caa9c39e59aba47de1646081591ed4c826abfe6 (diff) | |
download | gitbook-2b5e836a3329917f1af4c0de51974b672994ec4b.zip gitbook-2b5e836a3329917f1af4c0de51974b672994ec4b.tar.gz gitbook-2b5e836a3329917f1af4c0de51974b672994ec4b.tar.bz2 |
Fix and improve tests for links in page
Diffstat (limited to 'test')
-rw-r--r-- | test/page.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/page.js b/test/page.js index b947519..52e6d4e 100644 --- a/test/page.js +++ b/test/page.js @@ -7,7 +7,7 @@ describe('Page', function() { before(function() { return mock.setupDefaultBook({ 'heading.md': '# Hello\n\n## World', - 'links.md': '[link](hello.md) [readme](README.md)', + 'links.md': '[link](hello.md) [link 2](variables/page/next.md) [readme](README.md)', 'codes/simple.md': '```hello world```', 'codes/lang.md': '```js\nhello world\n```', @@ -130,7 +130,15 @@ describe('Page', function() { it('should replace links to page to .html', function() { page.content.should.be.html({ - 'a[href="index.html"]': { + 'a[href="./"]': { + count: 1 + } + }); + }); + + it('should use directory urls when file is a README', function() { + page.content.should.be.html({ + 'a[href="./"]': { count: 1 } }); |