summaryrefslogtreecommitdiffstats
path: root/test/plugins.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/plugins.js')
-rw-r--r--test/plugins.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/test/plugins.js b/test/plugins.js
index 03bbc26..8207663 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -138,8 +138,7 @@ describe('Plugins', function() {
});
});
-
- it('should list all resources for website', function() {
+ it('should list all filters', function() {
_.size(filters).should.equal(2);
});
@@ -151,5 +150,30 @@ describe('Plugins', function() {
filters.testContext('Hello');
});
});
+
+ describe('Blocks', function() {
+ var plugin, blocks;
+
+ before(function() {
+ plugin = new BookPlugin(book, 'test-blocks');
+ return plugin.load(PLUGINS_ROOT)
+
+ .then(function() {
+ blocks = plugin.getBlocks();
+ });
+ });
+
+ it('should list all blocks', function() {
+ _.size(blocks).should.equal(2);
+ });
+
+ it('should correctly normalize block', function() {
+ blocks.hello.exec({ body: 'World' }).should.equal('Hello World!');
+ });
+
+ it('should correctly set contexts for filter', function() {
+ blocks.testContext.exec({ body: 'Hello' });
+ });
+ });
});