summaryrefslogtreecommitdiffstats
path: root/test/page.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-02-13 10:43:22 +0100
committerSamy Pesse <samypesse@gmail.com>2016-02-13 10:43:22 +0100
commit272f30af532b247e2b13d2d0b59c89a041723e9a (patch)
tree5a0ee666ab8dfafaa30addf5171a0a52b3695be7 /test/page.js
parent4c6717e23488656686f276aa2b40ce1d1c7641f8 (diff)
downloadgitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.zip
gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.gz
gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.bz2
Complete test for convertion of svgs
Diffstat (limited to 'test/page.js')
-rw-r--r--test/page.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/page.js b/test/page.js
index 9007c45..d844d13 100644
--- a/test/page.js
+++ b/test/page.js
@@ -38,6 +38,18 @@ describe('Page', function() {
});
});
+ describe('.relative', function() {
+ it('should correctly resolve absolute path in the book', function() {
+ var page = book.addPage('heading.md');
+ var page2 = book.addPage('folder/paths.md');
+
+ page.relative('/test.png').should.equal('test.png');
+ page.relative('test.png').should.equal('test.png');
+ page2.relative('/test.png').should.equal('../test.png');
+ page2.relative('test.png').should.equal('test.png');
+ });
+ });
+
describe('Headings', function() {
it('should add a default ID to headings', function() {
var page = book.addPage('heading.md');