summaryrefslogtreecommitdiffstats
path: root/test/plugins.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/plugins.js')
-rw-r--r--test/plugins.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/plugins.js b/test/plugins.js
index 576c96b..03bbc26 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -1,3 +1,4 @@
+var _ = require('lodash');
var path = require('path');
var mock = require('./mock');
@@ -124,5 +125,31 @@ describe('Plugins', function() {
});
});
});
+
+ describe('Filters', function() {
+ var plugin, filters;
+
+ before(function() {
+ plugin = new BookPlugin(book, 'test-filters');
+ return plugin.load(PLUGINS_ROOT)
+
+ .then(function() {
+ filters = plugin.getFilters();
+ });
+ });
+
+
+ it('should list all resources for website', function() {
+ _.size(filters).should.equal(2);
+ });
+
+ it('should correctly execute a filter', function() {
+ filters.hello('World').should.equal('Hello World!');
+ });
+
+ it('should correctly set contexts for filter', function() {
+ filters.testContext('Hello');
+ });
+ });
});