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

Commit 6058ad79 by Yoni Jah

apply test to all dialects ,removed forgotten test.only statement

1 parent d2fda607
Showing with 30 additions and 32 deletions
...@@ -386,39 +386,37 @@ describe(Support.getTestDialectTeaser('Sequelize'), function() { ...@@ -386,39 +386,37 @@ describe(Support.getTestDialectTeaser('Sequelize'), function() {
}).to.throw(Error, 'Both `replacements` and `bind` cannot be set at the same time'); }).to.throw(Error, 'Both `replacements` and `bind` cannot be set at the same time');
}); });
if (Support.dialectIsMySQL()) { it('properly adds and escapes replacement value', function () {
it.only('properly adds and escapes replacement value', function () { var logSql,
var logSql, number = 1,
number = 1, date = new Date(),
date = new Date(), string = 't\'e"st',
string = 't\'e"st', boolean = true,
boolean = true, buffer = new Buffer('t\'e"st');
buffer = new Buffer('t\'e"st');
date.setMilliseconds(0);
date.setMilliseconds(0); return this.sequelize.query({
return this.sequelize.query({ query: 'select ? as number, ? as date,? as string,? as boolean,? as buffer',
query: 'select ? as number, ? as date,? as string,? as boolean,? as buffer', values: [number, date, string, boolean, buffer]
values: [number, date, string, boolean, buffer] }, {
}, { type: this.sequelize.QueryTypes.SELECT,
type: this.sequelize.QueryTypes.SELECT, logging: function(s) {
logging: function(s) { logSql = s;
logSql = s; }
} }).then(function(result) {
}).then(function(result) { var res = result[0] || {};
var res = result[0] || {}; res.date = res.date && new Date(res.date);
res.date = res.date && new Date(res.date); res.boolean = res.boolean && true;
res.boolean = res.boolean && true; expect(res).to.deep.equal({
expect(res).to.deep.equal({ number : number,
number : number, date : date,
date : date, string : string,
string : string, boolean: boolean,
boolean: boolean, buffer : buffer
buffer : buffer });
}); expect(logSql.indexOf('?')).to.equal(-1);
expect(logSql.indexOf('?')).to.equal(-1);
});
}); });
} });
it('uses properties `query` and `values` if query is tagged', function() { it('uses properties `query` and `values` if query is tagged', function() {
var logSql; var logSql;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!