Skip to content

Commit

Permalink
test fixture for issue resolving Automattic#1180
Browse files Browse the repository at this point in the history
  • Loading branch information
vedmalex authored and aheckmann committed Nov 2, 2012
1 parent 58807bb commit a56610c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/model.query.casting.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 235,13 @@ describe('model query casting', function(){
});
})
})

it('properly casts $and (gh-1180)', function (done) {
var db = start()
, B = db.model(modelName, collection random())
, result = B.find({}).cast(B, {$and:[{date:'1987-03-17T20:00:00.000Z'}, {_id:'000000000000000000000000'}]});
assert.ok(result.$and[0].date instanceof Date);
assert.ok(result.$and[1]._id instanceof DocumentObjectId);
done();
})
});

0 comments on commit a56610c

Please sign in to comment.