不要怂,就是干,撸起袖子干!

Commit 867c3745 by Sohum Banerjea

test for smartWhere on binary data

1 parent 2871f813
Showing with 16 additions and 2 deletions
......@@ -24,7 +24,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
data: DataTypes.STRING,
intVal: DataTypes.INTEGER,
theDate: DataTypes.DATE,
aBool: DataTypes.BOOLEAN
aBool: DataTypes.BOOLEAN,
binary: DataTypes.STRING(16, true)
})
this.User.sync({ force: true }).success(function() {
......@@ -63,9 +64,12 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
beforeEach(function(done) {
var self = this
this.buf = new Buffer(16);
this.buf.fill('\x01');
this.User.bulkCreate([
{username: 'boo', intVal: 5, theDate: '2013-01-01 12:00'},
{username: 'boo2', intVal: 10, theDate: '2013-01-10 12:00'}
{username: 'boo2', intVal: 10, theDate: '2013-01-10 12:00', binary: this.buf }
]).success(function(user2) {
done()
})
......@@ -92,6 +96,16 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
});
})
it('should not break when using smart syntax on binary fields', function (done) {
this.User.findAll({
where: {
binary: [ this.buf, this.buf ]
}
}).success(function(users){
done();
});
});
it('should be able to find a row using like', function(done) {
this.User.findAll({
where: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!