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 9e82d76d
authored
Apr 29, 2013
by
Michael Weibel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for checking the new behaviour
1 parent
3791a296
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
spec/dao.spec.js
spec/dao.spec.js
View file @
9e82d76
...
@@ -19,7 +19,11 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
...
@@ -19,7 +19,11 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
username
:
{
type
:
DataTypes
.
STRING
},
username
:
{
type
:
DataTypes
.
STRING
},
touchedAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
DataTypes
.
NOW
},
touchedAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
DataTypes
.
NOW
},
aNumber
:
{
type
:
DataTypes
.
INTEGER
},
aNumber
:
{
type
:
DataTypes
.
INTEGER
},
bNumber
:
{
type
:
DataTypes
.
INTEGER
}
bNumber
:
{
type
:
DataTypes
.
INTEGER
},
dateAllowNullTrue
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
}
})
})
self
.
HistoryLog
=
sequelize
.
define
(
'HistoryLog'
,
{
self
.
HistoryLog
=
sequelize
.
define
(
'HistoryLog'
,
{
...
@@ -320,6 +324,29 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
...
@@ -320,6 +324,29 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
expect
(
+
user
.
touchedAt
).
toBe
(
5000
)
expect
(
+
user
.
touchedAt
).
toBe
(
5000
)
})
})
})
})
describe
(
'allowNull date'
,
function
()
{
it
(
'should be just "null" and not Date with Invalid Date'
,
function
(
done
)
{
var
self
=
this
;
this
.
User
.
build
({
username
:
'a user'
}).
save
().
success
(
function
()
{
self
.
User
.
find
({
where
:
{
username
:
'a user'
}}).
success
(
function
(
user
)
{
expect
(
user
.
dateAllowNullTrue
).
toBe
(
null
)
done
()
})
})
})
it
(
'should be the same valid date when saving the date'
,
function
(
done
)
{
var
self
=
this
;
var
date
=
new
Date
();
this
.
User
.
build
({
username
:
'a user'
,
dateAllowNullTrue
:
date
}).
save
().
success
(
function
()
{
self
.
User
.
find
({
where
:
{
username
:
'a user'
}}).
success
(
function
(
user
)
{
expect
(
user
.
dateAllowNullTrue
.
toString
()).
toEqual
(
date
.
toString
())
done
()
})
})
})
})
})
})
describe
(
'complete'
,
function
()
{
describe
(
'complete'
,
function
()
{
...
...
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