Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 15eac3e5
authored
Jul 01, 2015
by
Richard Comley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extra tests that check limit and order get blatted in count
1 parent
c5cccd41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
test/integration/model.test.js
test/integration/model.test.js
100644 → 100755
View file @
15eac3e
...
...
@@ -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
({
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment