diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-27 22:51:07 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-27 22:51:07 +0100 |
commit | 36f2f5d52e54c03036f05225df3f58e9833f3e71 (patch) | |
tree | 67fe034938ba51a09fcaf6a4bf134631be09f20b /test | |
parent | ddc99104d4394cc21eaa615b01d73ec001ac7a16 (diff) | |
download | gitbook-36f2f5d52e54c03036f05225df3f58e9833f3e71.zip gitbook-36f2f5d52e54c03036f05225df3f58e9833f3e71.tar.gz gitbook-36f2f5d52e54c03036f05225df3f58e9833f3e71.tar.bz2 |
Add method glossary.find
Diffstat (limited to 'test')
-rw-r--r-- | test/glossary.js | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/test/glossary.js b/test/glossary.js index e2c9e2b..116eabf 100644 --- a/test/glossary.js +++ b/test/glossary.js @@ -55,22 +55,17 @@ describe('Glossary', function() { should.not.exist(entry); }); }); - }); - - it('should parse glossary entries', function() { - return mock.setupDefaultBook({ - 'GLOSSARY.md': '# Glossary\n\n### Hello World\n\nThis is an entry' - }) - .then(function(book) { - return book.prepareConfig() - - .then(function() { - return book.glossary.load(); - }) - .then(function() { - + describe('glossary.find', function() { + it('should return an existing entry', function() { + var entry = book.glossary.find('HeLLo World'); + should.exist(entry); + entry.id.should.equal('hello_world'); + }); + it('should undefined return non existing entry', function() { + var entry = book.glossary.find('Hello'); + should.not.exist(entry); }); }); }); |