Skip to content

Commit

Permalink
add failing test for keys named 'type'
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Mar 23, 2011
1 parent 2290833 commit 1d15fbe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/model.test.js
Expand Up @@ -1022,6 +1022,22 @@ module.exports = {
db.close();
},

'test "type" is allowed as a key': function(){
var now = Date.now();

mongoose.model('TestTypeDefaults', new Schema({
type: { type: String, default: 'YES!' }
}));

var db = start()
, TestDefaults = db.model('TestTypeDefaults');

var post = new TestDefaults();
post.get('type').should.be.a('string');
post.get('type').should.eql('YES!');
db.close();
},

'test nested defaults application': function(){
var now = Date.now();

Expand Down

0 comments on commit 1d15fbe

Please sign in to comment.