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

Commit 360962d9 by Andreas Franzen

added a test

1 parent d8231d26
Showing with 7 additions and 0 deletions
...@@ -202,6 +202,13 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () { ...@@ -202,6 +202,13 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
}) })
}) })
it('replaces named parameters with the passed object and ignore those which does not qualify', function(done) {
this.sequelize.query('select :one as foo, :two as bar, "00:00" as baz', null, { raw: true }, { one: 1, two: 2 }).success(function(result) {
expect(result).to.deep.equal([{ foo: 1, bar: 2, baz: '00:00' }])
done()
})
})
it('replaces named parameters with the passed object using the same key twice', function(done) { it('replaces named parameters with the passed object using the same key twice', function(done) {
this.sequelize.query('select :one as foo, :two as bar, :one as baz', null, { raw: true }, { one: 1, two: 2 }).success(function(result) { this.sequelize.query('select :one as foo, :two as bar, :one as baz', null, { raw: true }, { one: 1, two: 2 }).success(function(result) {
expect(result).to.deep.equal([{ foo: 1, bar: 2, baz: 1 }]) expect(result).to.deep.equal([{ foo: 1, bar: 2, baz: 1 }])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!