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 dc1930c9
authored
Jul 25, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed broken mysql spec
1 parent
7e823676
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
test/dao-factory.test.js
test/dao-factory.test.js
View file @
dc1930c
...
@@ -2400,8 +2400,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -2400,8 +2400,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
afterEach
(
function
(
done
)
{
afterEach
(
function
(
done
)
{
var
self
=
this
var
self
=
this
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'posts'
).
success
(
function
()
{
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'posts'
,
{
force
:
true
}
).
success
(
function
()
{
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'authors'
).
success
(
function
()
{
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'authors'
,
{
force
:
true
}
).
success
(
function
()
{
done
()
done
()
})
})
})
})
...
@@ -2410,13 +2410,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -2410,13 +2410,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it
(
'uses an existing dao factory and references the author table'
,
function
(
done
)
{
it
(
'uses an existing dao factory and references the author table'
,
function
(
done
)
{
var
self
=
this
var
self
=
this
,
Post
=
this
.
sequelize
.
define
(
'post'
,
{
,
Post
=
this
.
sequelize
.
define
(
'post'
,
{
title
:
Sequelize
.
STRING
,
title
:
Sequelize
.
STRING
,
authorId
:
{
authorId
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
references
:
this
.
Author
,
references
:
this
.
Author
,
referencesKey
:
"id"
referencesKey
:
"id"
}
}
})
})
this
.
Author
.
hasMany
(
Post
)
this
.
Author
.
hasMany
(
Post
)
Post
.
belongsTo
(
this
.
Author
)
Post
.
belongsTo
(
this
.
Author
)
...
@@ -2441,13 +2441,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -2441,13 +2441,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it
(
'uses a table name as a string and references the author table'
,
function
(
done
)
{
it
(
'uses a table name as a string and references the author table'
,
function
(
done
)
{
var
self
=
this
var
self
=
this
,
Post
=
self
.
sequelize
.
define
(
'post'
,
{
,
Post
=
self
.
sequelize
.
define
(
'post'
,
{
title
:
Sequelize
.
STRING
,
title
:
Sequelize
.
STRING
,
authorId
:
{
authorId
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
references
:
'authors'
,
references
:
'authors'
,
referencesKey
:
"id"
referencesKey
:
"id"
}
}
})
})
this
.
Author
.
hasMany
(
Post
)
this
.
Author
.
hasMany
(
Post
)
Post
.
belongsTo
(
this
.
Author
)
Post
.
belongsTo
(
this
.
Author
)
...
@@ -2472,13 +2472,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -2472,13 +2472,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it
(
"emits an error event as the referenced table name is invalid"
,
function
(
done
)
{
it
(
"emits an error event as the referenced table name is invalid"
,
function
(
done
)
{
var
self
=
this
var
self
=
this
,
Post
=
this
.
sequelize
.
define
(
'post'
,
{
,
Post
=
this
.
sequelize
.
define
(
'post'
,
{
title
:
Sequelize
.
STRING
,
title
:
Sequelize
.
STRING
,
authorId
:
{
authorId
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
references
:
'4uth0r5'
,
references
:
'4uth0r5'
,
referencesKey
:
"id"
referencesKey
:
"id"
}
}
})
})
this
.
Author
.
hasMany
(
Post
)
this
.
Author
.
hasMany
(
Post
)
Post
.
belongsTo
(
this
.
Author
)
Post
.
belongsTo
(
this
.
Author
)
...
@@ -2495,7 +2495,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -2495,7 +2495,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}
}
}).
error
(
function
(
err
)
{
}).
error
(
function
(
err
)
{
if
(
dialect
===
'mysql'
)
{
if
(
dialect
===
'mysql'
)
{
expect
(
err
.
message
).
to
.
match
(
/ER_CAN
NOT_ADD_FOREIGN
/
)
expect
(
err
.
message
).
to
.
match
(
/ER_CAN
T_CREATE_TABLE
/
)
}
}
else
if
(
dialect
===
'sqlite'
)
{
else
if
(
dialect
===
'sqlite'
)
{
// the parser should not end up here ... see above
// the parser should not end up here ... see above
...
...
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