summaryrefslogtreecommitdiffstats
path: root/test/json.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-24 15:33:04 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-24 15:33:04 +0100
commite02f29e76392660b31be87063649abd4adb22826 (patch)
treedfda77c00534b64701784f32daf21af08a0639b7 /test/json.js
parent6805b02c63c95e297bf69ce68800e021e744c052 (diff)
downloadgitbook-e02f29e76392660b31be87063649abd4adb22826.zip
gitbook-e02f29e76392660b31be87063649abd4adb22826.tar.gz
gitbook-e02f29e76392660b31be87063649abd4adb22826.tar.bz2
Add test for local inclusion
Diffstat (limited to 'test/json.js')
-rw-r--r--test/json.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/json.js b/test/json.js
index 1620d00..5852df7 100644
--- a/test/json.js
+++ b/test/json.js
@@ -41,4 +41,13 @@ describe('JSON generator', function () {
assert(fs.existsSync(path.join(output, "test2.json")));
}, done);
});
+
+ it('should correctly generate a book with inclusion', function(done) {
+ testGeneration(books[5], "json", function(output) {
+ assert(fs.existsSync(path.join(output, "README.json")));
+
+ var readme = JSON.parse(fs.readFileSync(path.join(output, "README.json")));
+ assert(readme.sections[0].content.indexOf('Hello World') > 0);
+ }, done);
+ });
});