Skip to content

Commit

Permalink
Added a failing test to expose setting with an object that has a nest…
Browse files Browse the repository at this point in the history
…ed hash.
  • Loading branch information
bnoguchi committed Jan 28, 2011
1 parent 4f3088d commit 2acff6d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/model.test.js
Expand Up @@ -218,6 +218,21 @@ module.exports = {
db.close();
},

'test initializing with a nested hash': function () {
var db = start()
, BlogPost = db.model('BlogPost');

var post = new BlogPost({
meta: {
date : new Date
, visitors : 5
}
});

post.get('meta.visitors').should.equal(5);
db.close();
},

'test isNew on embedded documents after initing': function(){
var db = start()
, BlogPost = db.model('BlogPost');
Expand Down

0 comments on commit 2acff6d

Please sign in to comment.