Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better nested object setter test

  • Loading branch information...
commit ccd86c64b0930730fc50a95c9488319bb5b10aa5 1 parent f2b9531
@aheckmann aheckmann authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 test/model.test.js
View
14 test/model.test.js
@@ -2728,16 +2728,20 @@ module.exports = {
(+post.get('meta').visitors).should.eql(234);
// set object directly
- post.meta = newmeta;
+ //post.meta = newmeta;
+ post.meta = {
+ date: date - 3000
+ , visitors: 4815162342
+ };
post.meta.date.should.be.an.instanceof(Date);
post.get('meta').date.should.be.an.instanceof(Date);
post.meta.visitors.should.be.an.instanceof(MongooseNumber);
post.get('meta').visitors.should.be.an.instanceof(MongooseNumber);
- (+post.meta.date).should.eql(date - 2000);
- (+post.get('meta').date).should.eql(date - 2000);
- (+post.meta.visitors).should.eql(234);
- (+post.get('meta').visitors).should.eql(234);
+ (+post.meta.date).should.eql(date - 3000);
+ (+post.get('meta').date).should.eql(date - 3000);
+ (+post.meta.visitors).should.eql(4815162342);
+ (+post.get('meta').visitors).should.eql(4815162342);
db.close();
Please sign in to comment.
Something went wrong with that request. Please try again.