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 de662364
authored
Aug 02, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speeeeeeeeeeecs
1 parent
70a79392
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
test/SequelizeTableTest.js
test/SequelizeTableTest.js
View file @
de66236
...
@@ -143,5 +143,57 @@ module.exports = {
...
@@ -143,5 +143,57 @@ module.exports = {
},
},
'identifier'
:
function
(
assert
)
{
'identifier'
:
function
(
assert
)
{
assert
.
equal
(
s
.
define
(
'Identifier'
,
{}).
identifier
,
'identifierId'
)
assert
.
equal
(
s
.
define
(
'Identifier'
,
{}).
identifier
,
'identifierId'
)
},
'values'
:
function
(
assert
)
{
var
day
=
new
Day
({
name
:
's'
})
assert
.
eql
(
day
.
values
,
{
name
:
"s"
,
createdAt
:
null
,
updatedAt
:
null
})
},
'save should set the id of a newly created object'
:
function
(
assert
,
beforeExit
)
{
var
subject
=
null
var
SaveTest
=
s
.
define
(
'SaveTest'
,
{
name
:
Sequelize
.
STRING
})
SaveTest
.
drop
(
function
(){
SaveTest
.
sync
(
function
()
{
new
SaveTest
({
name
:
's'
}).
save
(
function
(
_saveTest
){
subject
=
_saveTest
})
})
})
beforeExit
(
function
()
{
assert
.
isNotNull
(
subject
.
id
)
})
},
'updateAttributes should update available attributes'
:
function
(
assert
,
beforeExit
)
{
var
subject
=
null
Day
.
drop
(
function
()
{
Day
.
sync
(
function
()
{
new
Day
({
name
:
'Monday'
}).
save
(
function
(
day
)
{
day
.
updateAttributes
({
name
:
'Sunday'
,
foo
:
'bar'
},
function
(
day
)
{
subject
=
day
})
})
})
})
beforeExit
(
function
()
{
assert
.
equal
(
subject
.
name
,
'Sunday'
)
assert
.
isUndefined
(
subject
.
foo
)
})
},
'destroy should make the object unavailable'
:
function
(
assert
,
beforeExit
)
{
var
subject
=
1
Day
.
drop
(
function
()
{
Day
.
sync
(
function
()
{
new
Day
({
name
:
'Monday'
}).
save
(
function
(
day
)
{
day
.
destroy
(
function
()
{
Day
.
find
(
day
.
id
,
function
(
result
)
{
subject
=
result
})
})
})
})
})
beforeExit
(
function
()
{
assert
.
isNull
(
subject
)
})
}
}
}
}
\ No newline at end of file
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