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

Commit 2a347ad2 by wenyuxiang

add test case for count `does not modify the passed arguments`

1 parent 9ce683e2
Showing with 10 additions and 9 deletions
......@@ -1486,7 +1486,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('does not modify the passed arguments - find', function (done) {
it('does not modify the passed arguments', function (done) {
var options = { where: ['specialkey = ?', 'awesome']}
this.UserPrimary.find(options).success(function(user) {
......@@ -1494,14 +1494,6 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
done()
})
})
it('does not modify the passed arguments - count', function (done) {
var options = { where: ['specialkey = ?', 'awesome']}
this.UserPrimary.count(options).success(function(count) {
expect(options).to.deep.equal({ where: ['specialkey = ?', 'awesome']})
done()
})
})
it('doesn\'t throw an error when entering in a non integer value for a specified primary field', function(done) {
this.UserPrimary.find('a string').success(function(user) {
......@@ -2760,6 +2752,15 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('does not modify the passed arguments', function (done) {
var options = { where: ['username = ?', 'user1']}
this.UserPrimary.count(options).success(function(count) {
expect(options).to.deep.equal({ where: ['username = ?', 'user1']})
done()
})
})
it('allows sql logging', function(done) {
this.User.count().on('sql', function(sql) {
expect(sql).to.exist
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!