summaryrefslogtreecommitdiffstats
path: root/test/json.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-03-24 09:36:51 +0100
committerSamy Pessé <samypesse@gmail.com>2015-03-24 09:36:51 +0100
commitd317741144c3179bf0a88eb731bb8195426405a6 (patch)
tree167064a9d7410b42967ebc798fcd03804f8eb26f /test/json.js
parent275739a77838ef256eeebeb48838e97420783f45 (diff)
downloadgitbook-d317741144c3179bf0a88eb731bb8195426405a6.zip
gitbook-d317741144c3179bf0a88eb731bb8195426405a6.tar.gz
gitbook-d317741144c3179bf0a88eb731bb8195426405a6.tar.bz2
Add basic test for multilingual book
Diffstat (limited to 'test/json.js')
-rw-r--r--test/json.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/json.js b/test/json.js
index e86ee4e..56483c6 100644
--- a/test/json.js
+++ b/test/json.js
@@ -49,4 +49,40 @@ describe('JSON generator', function () {
});
});
});
+
+ describe('Multilingual Book', function() {
+ var book;
+
+ before(function() {
+ return books.generate("languages", "json")
+ .then(function(_book) {
+ book = _book;
+ });
+ });
+
+ it('should correctly output a README.json', function() {
+ book.should.have.file("README.json");
+ });
+
+ it('should output a valid json', function() {
+ book.should.have.jsonfile("README.json");
+ });
+
+ describe('Page Format', function() {
+ var page;
+
+ before(function() {
+ page = JSON.parse(
+ fs.readFileSync(
+ path.join(book.options.output, "README.json"),
+ { encoding: "utf-8" }
+ )
+ );
+ });
+
+ it('should contains no languages', function() {
+ page.should.have.property("langs").with.lengthOf(2);
+ });
+ });
+ });
});