diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-02-06 15:07:01 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-02-06 15:07:01 +0100 |
commit | c3ffa5e0ef425fe941e21a3d7937cbc149336d0e (patch) | |
tree | 168d3a506e77841cd90e883dc1758899a0881af2 /test/glossary.js | |
parent | 724bc2b59c6d0ac9060d1be0759a144bcb2305be (diff) | |
download | gitbook-c3ffa5e0ef425fe941e21a3d7937cbc149336d0e.zip gitbook-c3ffa5e0ef425fe941e21a3d7937cbc149336d0e.tar.gz gitbook-c3ffa5e0ef425fe941e21a3d7937cbc149336d0e.tar.bz2 |
Add test for glossary replacement #588
Diffstat (limited to 'test/glossary.js')
-rw-r--r-- | test/glossary.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/glossary.js b/test/glossary.js new file mode 100644 index 0000000..442f857 --- /dev/null +++ b/test/glossary.js @@ -0,0 +1,22 @@ +var path = require('path'); +var _ = require('lodash'); +var assert = require('assert'); +var cheerio = require('cheerio'); + +var fs = require("fs"); +var fsUtil = require("../lib/utils/fs"); + + +describe('Glossary Generation', function () { + it('should correctly replace glossary terms', function(done) { + testGeneration(books[0], "website", function(output) { + var content = fs.readFileSync(path.join(output, "index.html"), { encoding: "utf8" }); + var $ = cheerio.load(content); + + var $body = $(".page-inner"); + var $a = $("a[href='GLOSSARY.html#description']"); + assert($a.length == 1); + assert($a.text() == "description"); + }, done); + }); +}); |