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 1da66da2
authored
Mar 30, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed beforeExit into exit
1 parent
760271a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
test/Model/find-findAll-all.js
test/Model/sync-drop.js
test/Model/find-findAll-all.js
View file @
1da66da
...
...
@@ -14,21 +14,28 @@ var initUsers = function(callback) {
})
}
module
.
exports
=
{
'all should return all created models'
:
function
(
beforeE
xit
)
{
initUsers
(
function
(
user
,
User
)
{
'all should return all created models'
:
function
(
e
xit
)
{
initUsers
(
function
(
_
,
User
)
{
User
.
all
.
on
(
'success'
,
function
(
users
)
{
assert
.
eql
(
users
.
length
,
2
)
beforeE
xit
()
e
xit
()
})
})
},
'find should return a single model'
:
function
(
beforeE
xit
)
{
'find should return a single model'
:
function
(
e
xit
)
{
initUsers
(
function
(
lastInsertedUser
,
User
)
{
User
.
find
(
lastInsertedUser
.
id
).
on
(
'success'
,
function
(
user
)
{
assert
.
eql
(
user
.
id
,
lastInsertedUser
.
id
)
beforeExit
()
exit
()
})
})
},
'find a specific user'
:
function
(
exit
)
{
initUsers
(
function
(
u
,
User
)
{
User
.
find
({
name
:
'foo'
}).
on
(
'success'
,
function
(
user
)
{
assert
.
eql
(
user
.
name
,
'foo'
)
exit
()
})
})
}
...
...
test/Model/sync-drop.js
View file @
1da66da
...
...
@@ -5,15 +5,15 @@ var assert = require("assert")
,
User
=
sequelize
.
define
(
'User'
,
{
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
})
module
.
exports
=
{
'sync should work with correct database config'
:
function
(
beforeE
xit
)
{
User
.
sync
().
on
(
'success'
,
beforeE
xit
)
'sync should work with correct database config'
:
function
(
e
xit
)
{
User
.
sync
().
on
(
'success'
,
e
xit
)
},
'sync should fail with incorrect database config'
:
function
(
beforeE
xit
)
{
'sync should fail with incorrect database config'
:
function
(
e
xit
)
{
var
s
=
new
Sequelize
(
'foo'
,
'bar'
,
null
,
{
logging
:
false
})
var
User2
=
s
.
define
(
'User'
,
{
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
})
User2
.
sync
().
on
(
'failure'
,
beforeE
xit
)
User2
.
sync
().
on
(
'failure'
,
e
xit
)
},
'drop should work'
:
function
(
beforeE
xit
)
{
User
.
drop
().
on
(
'success'
,
beforeE
xit
)
'drop should work'
:
function
(
e
xit
)
{
User
.
drop
().
on
(
'success'
,
e
xit
)
}
}
\ 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