diff options
Diffstat (limited to 'test/glossary.js')
-rw-r--r-- | test/glossary.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/glossary.js b/test/glossary.js index 16ab0fc..c616a51 100644 --- a/test/glossary.js +++ b/test/glossary.js @@ -17,4 +17,40 @@ describe('Glossary', function () { book.glossary.should.have.lengthOf(2); }); }); + + describe('Generation', function() { + var book; + + before(function() { + return books.generate("glossary", "website") + .then(function(_book) { + book = _book; + }); + }); + + it('should correctly generate a GLOSSARY.html', function() { + book.should.have.file("GLOSSARY.html"); + }); + + describe('Page Integration', function() { + var page; + + before(function() { + page = fs.readFileSync( + path.join(book.options.output, "index.html"), + { encoding: "utf-8" } + ); + }); + + it('should correctly replaced terms by links', function() { + page.should.be.html(".page-inner a[href='GLOSSARY.html#test']", { + count: 1, + text: "test", + attributes: { + title: "Just a simple and easy to understand test." + } + }); + }); + }); + }); }); |