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 720e40fb
authored
Sep 22, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added basic test for fetching associations
1 parent
79719ebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
test/Table/fetchAssociations.js
test/Table/fetchAssociations.js
0 → 100644
View file @
720e40f
var
Sequelize
=
require
(
__dirname
+
"/../../lib/sequelize/Sequelize"
).
Sequelize
,
s
=
new
Sequelize
(
'sequelize_test'
,
'root'
,
null
,
{
disableLogging
:
true
}),
Foo
=
s
.
define
(
'Foo'
,
{
name
:
Sequelize
.
TEXT
}),
Bar
=
s
.
define
(
'Bar'
,
{
nr
:
Sequelize
.
INTEGER
})
module
.
exports
=
{
'should store data inside the fetchedAssociations hash'
:
function
(
assert
,
beforeExit
)
{
var
allowExit
=
false
Foo
.
hasMany
(
'bars'
,
Bar
,
'foos'
)
Sequelize
.
chainQueries
([{
drop
:
s
},
{
sync
:
s
}],
function
()
{
var
foo
=
new
Foo
({
name
:
'asd'
})
foo
.
save
(
function
()
{
assert
.
eql
(
foo
.
fetchedAssociations
,
{})
foo
.
fetchAssociations
(
function
()
{
assert
.
eql
(
foo
.
fetchedAssociations
,
{
bars
:
[]})
allowExit
=
true
})
})
})
beforeExit
(
function
()
{
assert
.
eql
(
allowExit
,
true
)
})
}
}
\ 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