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

You need to sign in or sign up before continuing.
Commit 15eac3e5 by Richard Comley

extra tests that check limit and order get blatted in count

1 parent c5cccd41
Showing with 39 additions and 0 deletions
......@@ -1641,6 +1641,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
});
});
});
it('returns multiple rows when using group', function() {
var self = this;
return this.User.bulkCreate([
......@@ -1665,6 +1666,44 @@ describe(Support.getTestDialectTeaser('Model'), function() {
});
});
describe("options sent to aggregate", function () {
var options, aggregateSpy;
beforeEach(function () {
options = { where: ['username = ?', 'user1']};
aggregateSpy = sinon.spy(this.User, "aggregate");
});
afterEach(function () {
var optsArg = aggregateSpy.args[0][2];
expect(optsArg.where).to.deep.equal(['username = ?', 'user1']);
aggregateSpy.restore();
});
it('modifies option "limit" by setting it to null', function() {
options.limit = 5;
return this.User.count(options).then(function() {
var optsArg = aggregateSpy.args[0][2];
expect(optsArg.limit).to.equal(null);
});
});
it('modifies option "order" by setting it to null', function() {
options.order = "username";
return this.User.count(options).then(function() {
var optsArg = aggregateSpy.args[0][2];
expect(optsArg.order).to.equal(null);
});
});
});
it('allows sql logging', function() {
var test = false;
return this.User.count({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!