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 90afc987
authored
Jul 02, 2015
by
Richard Comley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improves tests for count
1 parent
3078c192
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
test/integration/model.test.js
test/integration/model.test.js
View file @
90afc98
...
@@ -1670,15 +1670,15 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -1670,15 +1670,15 @@ describe(Support.getTestDialectTeaser('Model'), function() {
var
options
,
aggregateSpy
;
var
options
,
aggregateSpy
;
beforeEach
(
function
()
{
beforeEach
(
function
()
{
options
=
{
where
:
[
'username = ?'
,
'user1'
]
};
options
=
{
where
:
{
username
:
'user1'
}
};
aggregateSpy
=
sinon
.
spy
(
this
.
User
,
"aggregate"
);
aggregateSpy
=
sinon
.
spy
(
this
.
User
,
"aggregate"
);
});
});
afterEach
(
function
()
{
afterEach
(
function
()
{
var
optsArg
=
aggregateSpy
.
args
[
0
][
2
];
expect
(
aggregateSpy
).
to
.
have
.
been
.
calledWith
(
sinon
.
match
.
any
,
sinon
.
match
.
any
,
expect
(
optsArg
.
where
).
to
.
deep
.
equal
([
'username = ?'
,
'user1'
]
);
sinon
.
match
.
object
.
and
(
sinon
.
match
.
has
(
'where'
,
{
username
:
'user1'
}))
);
aggregateSpy
.
restore
();
aggregateSpy
.
restore
();
});
});
...
@@ -1687,9 +1687,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -1687,9 +1687,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
options
.
limit
=
5
;
options
.
limit
=
5
;
return
this
.
User
.
count
(
options
).
then
(
function
()
{
return
this
.
User
.
count
(
options
).
then
(
function
()
{
var
optsArg
=
aggregateSpy
.
args
[
0
][
2
];
expect
(
aggregateSpy
).
to
.
have
.
been
.
calledWith
(
sinon
.
match
.
any
,
sinon
.
match
.
any
,
expect
(
optsArg
.
limit
).
to
.
equal
(
null
);
sinon
.
match
.
object
.
and
(
sinon
.
match
.
has
(
'limit'
,
null
))
);
});
});
});
});
...
@@ -1697,9 +1697,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -1697,9 +1697,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
options
.
offset
=
10
;
options
.
offset
=
10
;
return
this
.
User
.
count
(
options
).
then
(
function
()
{
return
this
.
User
.
count
(
options
).
then
(
function
()
{
var
optsArg
=
aggregateSpy
.
args
[
0
][
2
];
expect
(
aggregateSpy
).
to
.
have
.
been
.
calledWith
(
sinon
.
match
.
any
,
sinon
.
match
.
any
,
expect
(
optsArg
.
offset
).
to
.
equal
(
null
);
sinon
.
match
.
object
.
and
(
sinon
.
match
.
has
(
'offset'
,
null
))
);
});
});
});
});
...
@@ -1707,9 +1707,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -1707,9 +1707,9 @@ describe(Support.getTestDialectTeaser('Model'), function() {
options
.
order
=
"username"
;
options
.
order
=
"username"
;
return
this
.
User
.
count
(
options
).
then
(
function
()
{
return
this
.
User
.
count
(
options
).
then
(
function
()
{
var
optsArg
=
aggregateSpy
.
args
[
0
][
2
];
expect
(
aggregateSpy
).
to
.
have
.
been
.
calledWith
(
sinon
.
match
.
any
,
sinon
.
match
.
any
,
expect
(
optsArg
.
order
).
to
.
equal
(
null
);
sinon
.
match
.
object
.
and
(
sinon
.
match
.
has
(
'order'
,
null
))
);
});
});
});
});
});
});
...
...
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