Permalink
Browse files

adding test for index.js

  • Loading branch information...
1 parent 0150092 commit 811f2883b8e3c47e53099dff05a17c2f99cb7561 @mariuskubilius committed Jan 7, 2013
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/test.index.js
View
@@ -0,0 +1,23 @@
+//dependencies
+var assert = require('assert');
+var mongoose = require('mongoose');
+var mongooseUtils = require('../index');
+var common = require('./utils/common');
+var db = common.db;
+var Schema = mongoose.Schema;
+
+describe('index', function () {
+ var MockSchema = new Schema();
+
+ describe('#default', function() {
+ MockSchema.plugin(mongooseUtils.slugify);
+ MockSchema.plugin(mongooseUtils.ancestorTree);
+ it('should be initialising all fields.', function(done){
+ assert.strictEqual(typeof MockSchema.paths.title, 'object');
+ assert.strictEqual(typeof MockSchema.paths.slug, 'object');
+ assert.strictEqual(typeof MockSchema.paths.parent, 'object');
+ assert.strictEqual(typeof MockSchema.paths.ancestors, 'object');
+ done();
+ });
+ });
+});

0 comments on commit 811f288

Please sign in to comment.