summaryrefslogtreecommitdiffstats
path: root/test/summary.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-03-30 22:01:37 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-03-30 22:01:37 -0700
commit603870ee07d2d62382cf19107643e0acb79e3b58 (patch)
tree5069c23336d2a62f5cb36c4fd58a2aacb49a0cda /test/summary.js
parent39a80421fc2bffe255cbfa06aea4d74876fb50b6 (diff)
downloadgitbook-603870ee07d2d62382cf19107643e0acb79e3b58.zip
gitbook-603870ee07d2d62382cf19107643e0acb79e3b58.tar.gz
gitbook-603870ee07d2d62382cf19107643e0acb79e3b58.tar.bz2
Add test for titles & paths
Diffstat (limited to 'test/summary.js')
-rw-r--r--test/summary.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/summary.js b/test/summary.js
index ea3df21..20535e2 100644
--- a/test/summary.js
+++ b/test/summary.js
@@ -11,12 +11,24 @@ var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
+
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
+
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
+
+ it('should detect paths and titles', function() {
+ assert(LEXED.chapters[0].chapter.path);
+ assert(LEXED.chapters[1].chapter.path);
+ assert(LEXED.chapters[2].chapter.path);
+
+ assert(LEXED.chapters[0].chapter.title);
+ assert(LEXED.chapters[1].chapter.title);
+ assert(LEXED.chapters[2].chapter.title);
+ });
});