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 f37fce43
authored
Dec 19, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved specs
1 parent
53e84f57
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
21 deletions
spec/model-factory.spec.js
test/Model/sync-drop.js
spec/model-factory.spec.js
View file @
f37fce4
...
@@ -475,4 +475,32 @@ describe('ModelFactory', function() {
...
@@ -475,4 +475,32 @@ describe('ModelFactory', function() {
expect
(
ModelFactory
.
prototype
.
belongsTo
).
toBeDefined
()
expect
(
ModelFactory
.
prototype
.
belongsTo
).
toBeDefined
()
})
})
})
})
describe
(
'sync'
,
function
()
{
it
(
'works with correct database credentials'
,
function
()
{
Helpers
.
async
(
function
(
done
)
{
User
.
sync
().
success
(
done
)
})
})
it
(
"fails with incorrect database credentials"
,
function
()
{
Helpers
.
async
(
function
(
done
)
{
var
sequelize2
=
new
Sequelize
(
'foo'
,
'bar'
,
null
,
{
logging
:
false
})
,
User2
=
sequelize2
.
define
(
'User'
,
{
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
})
User2
.
sync
().
error
(
function
(
err
)
{
expect
(
err
.
message
).
toEqual
(
"Access denied for user ''@'localhost' to database 'foo'"
)
done
()
})
})
})
})
describe
(
'drop should work'
,
function
()
{
it
(
'correctly succeeds'
,
function
()
{
Helpers
.
async
(
function
(
done
)
{
User
.
drop
().
success
(
done
)
})
})
})
})
})
test/Model/sync-drop.js
deleted
100644 → 0
View file @
53e84f5
var
assert
=
require
(
"assert"
)
,
config
=
require
(
"./../config"
)
,
Sequelize
=
require
(
"./../../index"
)
,
sequelize
=
new
Sequelize
(
config
.
database
,
config
.
username
,
config
.
password
,
{
logging
:
false
,
define
:
{
charset
:
'latin1'
}})
,
User
=
sequelize
.
define
(
'User'
,
{
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
})
module
.
exports
=
{
'sync should work with correct database config'
:
function
(
exit
)
{
User
.
sync
().
on
(
'success'
,
function
(){
exit
(
function
(){})})
},
'sync should fail with incorrect database config'
:
function
(
exit
)
{
var
s
=
new
Sequelize
(
'foo'
,
'bar'
,
null
,
{
logging
:
false
})
var
User2
=
s
.
define
(
'User'
,
{
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
})
User2
.
sync
().
on
(
'failure'
,
function
(
err
){
exit
(
function
(){}
)})
},
'drop should work'
:
function
(
exit
)
{
User
.
drop
().
on
(
'success'
,
function
(){
exit
(
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