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 93353db2
authored
Jan 08, 2014
by
Sascha Gehlich
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/add-association-transaction-support' into feature/create-relation-objects
2 parents
c2ff91c1
8d13b444
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
test/associations/has-many.test.js
test/associations/has-many.test.js
View file @
93353db
...
@@ -705,27 +705,23 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
...
@@ -705,27 +705,23 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
describe
(
'addAssociations'
,
function
()
{
describe
(
'addAssociations'
,
function
()
{
it
(
'supports transactions'
,
function
(
done
)
{
it
(
'supports transactions'
,
function
(
done
)
{
var
self
=
this
Support
.
prepareTransactionTest
(
this
.
sequelize
,
function
(
sequelize
)
{
Support
.
prepareTransactionTest
(
this
.
sequelize
,
function
(
sequelize
)
{
var
User
=
se
lf
.
se
quelize
.
define
(
'User'
,
{
username
:
DataTypes
.
STRING
})
var
User
=
sequelize
.
define
(
'User'
,
{
username
:
DataTypes
.
STRING
})
,
Task
=
se
lf
.
se
quelize
.
define
(
'Task'
,
{
title
:
DataTypes
.
STRING
})
,
Task
=
sequelize
.
define
(
'Task'
,
{
title
:
DataTypes
.
STRING
})
User
.
hasMany
(
Task
)
User
.
hasMany
(
Task
)
Task
.
hasMany
(
User
)
Task
.
hasMany
(
User
)
User
.
sync
({
force
:
true
}).
success
(
function
()
{
sequelize
.
sync
({
force
:
true
}).
success
(
function
()
{
Task
.
sync
({
force
:
true
}).
success
(
function
()
{
User
.
create
({
username
:
'foo'
}).
success
(
function
(
user
)
{
User
.
create
({
username
:
'foo'
}).
success
(
function
(
user
)
{
Task
.
create
({
title
:
'task'
}).
success
(
function
(
task
)
{
Task
.
create
({
title
:
'task'
}).
success
(
function
(
task
)
{
sequelize
.
transaction
(
function
(
t
){
self
.
sequelize
.
transaction
(
function
(
t
){
task
.
addUser
(
user
,
{
transaction
:
t
}).
success
(
function
()
{
task
.
addUser
(
user
,
{
transaction
:
t
}).
success
(
function
()
{
task
.
hasUser
(
user
).
success
(
function
(
hasUser
)
{
task
.
hasUser
(
user
).
success
(
function
(
hasUser
)
{
expect
(
hasUser
).
to
.
be
.
false
expect
(
hasUser
).
to
.
be
.
false
task
.
hasUser
(
user
,
{
transaction
:
t
}).
success
(
function
(
hasUser
)
{
task
.
hasUser
(
user
,
{
transaction
:
t
}).
success
(
function
(
hasUser
)
{
expect
(
hasUser
).
to
.
be
.
true
expect
(
hasUser
).
to
.
be
.
true
t
.
rollback
().
success
(
function
()
{
done
()
})
t
.
rollback
().
success
(
function
()
{
done
()
})
})
})
})
})
})
})
})
...
...
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