Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding test for index.js

  • Loading branch information...
commit 811f2883b8e3c47e53099dff05a17c2f99cb7561 1 parent 0150092
@mariuskubilius authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/test.index.js
View
23 test/test.index.js
@@ -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();
+ });
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.