summaryrefslogtreecommitdiffstats
path: root/test/glossary.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-03-24 11:27:37 +0100
committerSamy Pessé <samypesse@gmail.com>2015-03-24 11:27:37 +0100
commitb61371942b0b29df418a1d7fda4fbec82afb534f (patch)
treeb447344846fbb41c6ed58f72f4e8c7ba15124513 /test/glossary.js
parent61c07e8876e1187b787dec412a496465a7f3bac0 (diff)
downloadgitbook-b61371942b0b29df418a1d7fda4fbec82afb534f.zip
gitbook-b61371942b0b29df418a1d7fda4fbec82afb534f.tar.gz
gitbook-b61371942b0b29df418a1d7fda4fbec82afb534f.tar.bz2
Add test for glossary replacements
Diffstat (limited to 'test/glossary.js')
-rw-r--r--test/glossary.js36
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."
+ }
+ });
+ });
+ });
+ });
});