diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
commit | ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62 (patch) | |
tree | 31ca85c3d2d93935eb6c351bd9e5ca317fc0e2a3 /test/summary.js | |
parent | ea98444dc0a6e59e79408963e1d340d7765ba9f6 (diff) | |
download | gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.zip gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.gz gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.bz2 |
Add order for tests
Diffstat (limited to 'test/summary.js')
-rw-r--r-- | test/summary.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/summary.js b/test/summary.js new file mode 100644 index 0000000..2744c43 --- /dev/null +++ b/test/summary.js @@ -0,0 +1,40 @@ +var mock = require('./mock'); + +describe('Summary / Table of contents', function() { + describe('Empty summary list', function() { + var book; + + before(function() { + return mock.setupDefaultBook({}) + .then(function(_book) { + book = _book; + return book.summary.load(); + }); + }); + + it('should correctly count articles', function() { + book.summary.count().should.equal(1); + }); + }); + + describe('Non-empty summary list', function() { + var book; + + before(function() { + return mock.setupDefaultBook({ + 'SUMMARY.md': '# Summary\n\n' + + '* [Hello](./hello.md)\n' + + '* [World](./world.md)\n\n' + }) + .then(function(_book) { + book = _book; + return book.summary.load(); + }); + }); + + it('should correctly count articles', function() { + book.summary.count().should.equal(3); + }); + }); +}); + |