From 603870ee07d2d62382cf19107643e0acb79e3b58 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Sun, 30 Mar 2014 22:01:37 -0700 Subject: [PATCH] Add test for titles & paths --- test/summary.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/summary.js b/test/summary.js index ea3df21fd..20535e2f3 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); + }); });