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

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 () { ...@@ -24,7 +24,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
data: DataTypes.STRING, data: DataTypes.STRING,
intVal: DataTypes.INTEGER, intVal: DataTypes.INTEGER,
theDate: DataTypes.DATE, theDate: DataTypes.DATE,
aBool: DataTypes.BOOLEAN aBool: DataTypes.BOOLEAN,
binary: DataTypes.STRING(16, true)
}) })
this.User.sync({ force: true }).success(function() { this.User.sync({ force: true }).success(function() {
...@@ -63,9 +64,12 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -63,9 +64,12 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
beforeEach(function(done) { beforeEach(function(done) {
var self = this var self = this
this.buf = new Buffer(16);
this.buf.fill('\x01');
this.User.bulkCreate([ this.User.bulkCreate([
{username: 'boo', intVal: 5, theDate: '2013-01-01 12:00'}, {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) { ]).success(function(user2) {
done() done()
}) })
...@@ -92,6 +96,16 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -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) { it('should be able to find a row using like', function(done) {
this.User.findAll({ this.User.findAll({
where: { where: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!