diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:45:25 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:45:25 +0100 |
commit | b244d506bd49526abbcfe84e2175b3410bbabb8c (patch) | |
tree | 361d53e96ab19e4e5eaca2176022da7d5d43b565 /test/summary.js | |
parent | 44f03865c0358d3c109256e58d5e8e6d1091d0b8 (diff) | |
download | gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.zip gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.tar.gz gitbook-b244d506bd49526abbcfe84e2175b3410bbabb8c.tar.bz2 |
Correctly setup summary instance when file doesn't exist
Diffstat (limited to 'test/summary.js')
-rw-r--r-- | test/summary.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/summary.js b/test/summary.js index 68c23b4..a98b6b7 100644 --- a/test/summary.js +++ b/test/summary.js @@ -33,6 +33,32 @@ describe('Summary / Table of contents', function() { }); }); + describe('Non-existant summary', function() { + var book; + + before(function() { + return mock.setupBook({ + 'README.md': 'Hello' + }) + .then(function(_book) { + book = _book; + + return book.readme.load() + .then(function() { + return book.summary.load(); + }); + }); + }); + + it('should add README as first entry', function() { + should(book.summary.getArticle('README.md')).be.ok(); + }); + + it('should correctly count articles', function() { + book.summary.count().should.equal(1); + }); + }); + describe('Non-empty summary list', function() { var book; |