diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-28 21:54:03 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-28 21:54:03 +0100 |
commit | 0494f7d1fd084f843cbca09aeb8e23ebb4075730 (patch) | |
tree | 9feb9f6a682abf4dffda68d00d5f5ce67500fc82 /test | |
parent | 4aa66338fce505566a2fe6ba6aee79ddf3f656a2 (diff) | |
download | gitbook-0494f7d1fd084f843cbca09aeb8e23ebb4075730.zip gitbook-0494f7d1fd084f843cbca09aeb8e23ebb4075730.tar.gz gitbook-0494f7d1fd084f843cbca09aeb8e23ebb4075730.tar.bz2 |
Fix #1165: correctly normalize path in summary to accept unicode
Diffstat (limited to 'test')
-rw-r--r-- | test/summary.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/summary.js b/test/summary.js index 08b9db8..9859693 100644 --- a/test/summary.js +++ b/test/summary.js @@ -59,6 +59,34 @@ describe('Summary / Table of contents', function() { }); }); + describe('Unicode summary', function() { + var book; + + before(function() { + return mockSummary({ + 'SUMMARY.md': '# Summary\n\n' + + '* [Hello](./hello world.md)\n' + + '* [Spanish](./Descripción del problema.md)\n\n' + + '* [Chinese](读了这本书.md)\n\n' + }) + .then(function(_book) { + book = _book; + }); + }); + + it('should accept article with spaces', function() { + should(book.summary.getArticle('hello world.md')).be.ok(); + }); + + it('should accept article with chinese filename', function() { + should(book.summary.getArticle('读了这本书.md')).be.ok(); + }); + + it('should accept article with accents', function() { + should(book.summary.getArticle('Descripción del problema.md')).be.ok(); + }); + }); + describe('Non-empty summary list', function() { var book; |