Skip to content

Commit

Permalink
Added test to find against strings using a Regular Expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoguchi committed Feb 14, 2011
1 parent 65f3491 commit ca7c136
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/model.querying.test.js
Expand Up @@ -858,5 +858,19 @@ module.exports = {
});
});
});
}
},

'test finding strings via regular expressions': function () {
var db = start()
, BlogPostB = db.model('BlogPostB', collection + random());

BlogPostB.create({title: 'Next to Normal'}, function (err, created) {
should.strictEqual(err, null);
BlogPostB.findOne({title: /^Next/}, function (err, found) {
should.strictEqual(err, null);
found._id.should.eql(created._id);
db.close();
});
});
},
};

0 comments on commit ca7c136

Please sign in to comment.