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 4e0d4884
authored
Dec 31, 2013
by
Martin Blumenstingl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prove with a unit-test that min() and max() do not work for date.
1 parent
92a7bac7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
test/dao-factory.test.js
test/dao-factory.test.js
View file @
4e0d488
...
@@ -1036,6 +1036,17 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -1036,6 +1036,17 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
})
})
})
})
it
(
"should allow dates in min"
,
function
(
done
){
var
self
=
this
this
.
User
.
bulkCreate
([{
theDate
:
new
Date
(
2000
,
01
,
01
)},
{
theDate
:
new
Date
(
1990
,
01
,
01
)}]).
success
(
function
(){
self
.
User
.
min
(
'theDate'
).
success
(
function
(
min
){
expect
(
min
).
to
.
be
.
a
(
'Date'
);
expect
(
new
Date
(
1990
,
01
,
01
)).
to
.
equalDate
(
min
)
done
()
})
})
})
})
})
describe
(
'max'
,
function
()
{
describe
(
'max'
,
function
()
{
...
@@ -1107,6 +1118,17 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -1107,6 +1118,17 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
})
})
it
(
"should allow dates in max"
,
function
(
done
)
{
var
self
=
this
this
.
User
.
bulkCreate
([{
theDate
:
new
Date
(
2013
,
12
,
31
)},
{
theDate
:
new
Date
(
2000
,
01
,
01
)}]).
success
(
function
(){
self
.
User
.
max
(
'theDate'
).
success
(
function
(
max
){
expect
(
max
).
to
.
be
.
a
(
'Date'
);
expect
(
max
).
to
.
equalDate
(
new
Date
(
2013
,
12
,
31
))
done
()
})
})
})
it
(
'allows sql logging'
,
function
(
done
)
{
it
(
'allows sql logging'
,
function
(
done
)
{
this
.
UserWithAge
.
max
(
'age'
).
on
(
'sql'
,
function
(
sql
)
{
this
.
UserWithAge
.
max
(
'age'
).
on
(
'sql'
,
function
(
sql
)
{
expect
(
sql
).
to
.
exist
expect
(
sql
).
to
.
exist
...
...
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