Permalink
Browse files

clean up test

  • Loading branch information...
1 parent 83d4590 commit 8653c73a7b741eb03fb96f07495d603c1090e53c @aheckmann aheckmann committed Feb 3, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 test/model.test.js
View
@@ -758,27 +758,28 @@ module.exports = {
});
});
},
-
+
+ // gh-662
'test nested structure created by merging': function() {
var db = start();
-
+
var MergedSchema = new Schema({
a: {
foo: String
}
});
-
+
MergedSchema.add({
a: {
b: {
bar: String
}
}
});
-
+
mongoose.model('Merged', MergedSchema);
var Merged = db.model('Merged', 'merged_' + Math.random());
-
+
var merged = new Merged({
a: {
foo: 'baz'
@@ -787,14 +788,14 @@ module.exports = {
}
}
});
-
+
merged.save(function(err) {
should.strictEqual(null, err);
Merged.findById(merged.id, function(err, found) {
+ db.close();
should.strictEqual(null, err);
found.a.foo.should.eql('baz');
found.a.b.bar.should.eql('qux');
- db.close();
});
});
},

0 comments on commit 8653c73

Please sign in to comment.