Permalink
Browse files

add failing test for keys named 'type'

  • Loading branch information...
1 parent 2290833 commit 1d15fbe25b7485d0d321ac95d55d9491e1e591b6 @aheckmann aheckmann committed Mar 23, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/model.test.js
View
@@ -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();

0 comments on commit 1d15fbe

Please sign in to comment.