Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix safe mode tests

account for background index creation
  • Loading branch information...
commit f7d214510dfb5d79c9ca10e0a2849293ab2529c3 1 parent 99758b1
@aheckmann aheckmann authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 test/model.test.js
View
12 test/model.test.js
@@ -2984,7 +2984,7 @@ describe('model', function(){
it('works', function(done){
var Human = new Schema({
name : String
- , email : { type: String, unique: true }
+ , email : { type: String, index: { unique: true, background: false }}
});
mongoose.model('SafeHuman', Human, true);
@@ -2992,6 +2992,10 @@ describe('model', function(){
var db = start()
, Human = db.model('SafeHuman', 'safehuman' + random());
+ Human.on('index', function (err) {
+ assert.ifError(err);
+ });
+
var me = new Human({
name : 'Guillermo Rauch'
, email : 'rauchg@gmail.com'
@@ -3022,7 +3026,7 @@ describe('model', function(){
it('can be disabled', function(done){
var Human = new Schema({
name : String
- , email : { type: String, unique: true }
+ , email : { type: String, index: { unique: true, background: false }}
});
// turn it off
@@ -3033,6 +3037,10 @@ describe('model', function(){
var db = start()
, Human = db.model('UnsafeHuman', 'unsafehuman' + random());
+ Human.on('index', function (err) {
+ assert.ifError(err);
+ });
+
var me = new Human({
name : 'Guillermo Rauch'
, email : 'rauchg@gmail.com'
Please sign in to comment.
Something went wrong with that request. Please try again.