Skip to content

Commit

Permalink
Added failing test for AutomatticGH-199
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Jan 31, 2011
1 parent af594b5 commit 6c4c791
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions test/model.test.js
Expand Up @@ -1559,7 +1559,26 @@ module.exports = {
db.close();
});
});
},

// GH-199
'test find queries with $in cast the values within the array': function () {
var db = start()
, BlogPost = db.model('BlogPost', collection);

var post = new BlogPost()
, id = DocumentObjectId.toString(post._id);

post.save(function (err) {
should.strictEqual(err, null);

BlogPost.findOne({ _id: { $in: [id] } }, function (err, doc) {
should.strictEqual(err, null);

DocumentObjectId.toString(doc._id).should.eql(id);
db.close();
});
});
},

'test filtering an embedded array by the id shortcut function': function () {
Expand Down Expand Up @@ -2034,7 +2053,7 @@ module.exports = {
mongoose.model('ShortcutGetterObject', schema);

var db = start()
, ShortcutGetter = db.model('ShortcutGetterObject')
, ShortcutGetter = db.model('ShortcutGetterObject', collection)
, post = new ShortcutGetter();

post.set('date', Date.now());
Expand All @@ -2046,7 +2065,7 @@ module.exports = {
// GH-195
'test that save on an unaltered model doesn\'t clear the document': function () {
var db = start()
, BlogPost = db.model('BlogPost');
, BlogPost = db.model('BlogPost', collection);

var post = new BlogPost();
post.title = 'woot';
Expand Down

0 comments on commit 6c4c791

Please sign in to comment.