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 1aaeeada
authored
Sep 20, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change a few tests in relation to Model.update signature change
1 parent
850e9093
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
test/dao.test.js
test/dao.validations.test.js
test/hooks.test.js
test/dao.test.js
View file @
1aaeead
...
...
@@ -551,7 +551,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
User
.
sync
({
force
:
true
}).
success
(
function
()
{
User
.
create
({
username
:
'foo'
}).
success
(
function
(
user
)
{
sequelize
.
transaction
().
then
(
function
(
t
)
{
User
.
update
({
username
:
'bar'
},
{
},
{
transaction
:
t
}).
success
(
function
()
{
User
.
update
({
username
:
'bar'
},
{
where
:
{
username
:
'foo'
},
transaction
:
t
}).
success
(
function
()
{
user
.
reload
().
success
(
function
(
user
)
{
expect
(
user
.
username
).
to
.
equal
(
'foo'
)
user
.
reload
({
transaction
:
t
}).
success
(
function
(
user
)
{
...
...
test/dao.validations.test.js
View file @
1aaeead
...
...
@@ -269,7 +269,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
User
.
sync
({
force
:
true
}).
success
(
function
()
{
User
.
create
({
username
:
'bob'
,
email
:
'hello@world.com'
}).
success
(
function
(
user
)
{
User
.
update
({
username
:
'toni'
},
{
id
:
user
.
id
})
.
update
({
username
:
'toni'
},
{
where
:
{
id
:
user
.
id
}
})
.
error
(
function
(
err
)
{
console
.
log
(
err
)
})
.
success
(
function
()
{
User
.
find
(
1
).
success
(
function
(
user
)
{
...
...
@@ -316,7 +316,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
Model
.
sync
({
force
:
true
}).
success
(
function
()
{
Model
.
create
({
name
:
'World'
}).
success
(
function
()
{
Model
.
update
({
name
:
''
},
{
id
:
1
}).
error
(
function
(
err
)
{
Model
.
update
({
name
:
''
},
{
where
:
{
id
:
1
}
}).
error
(
function
(
err
)
{
expect
(
err
).
to
.
be
.
an
.
instanceOf
(
Error
)
expect
(
err
.
get
(
'name'
)[
0
].
message
).
to
.
equal
(
'Validation notEmpty failed'
)
done
()
...
...
test/hooks.test.js
View file @
1aaeead
...
...
@@ -3081,7 +3081,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
{
username
:
'Cheech'
,
mood
:
'sad'
},
{
username
:
'Chong'
,
mood
:
'sad'
}
]).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
mood
:
'sad'
}).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
where
:
{
mood
:
'sad'
}
}).
success
(
function
()
{
expect
(
beforeHook
).
to
.
be
.
true
expect
(
afterHook
).
to
.
be
.
true
done
()
...
...
@@ -3132,7 +3132,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
{
username
:
'Cheech'
,
mood
:
'sad'
},
{
username
:
'Chong'
,
mood
:
'sad'
}
]).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
mood
:
'sad'
}).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
where
:
{
mood
:
'sad'
}
}).
success
(
function
()
{
expect
(
beforeHook
).
to
.
be
.
true
expect
(
afterHook
).
to
.
be
.
true
done
()
...
...
@@ -3173,7 +3173,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
{
username
:
'Cheech'
,
mood
:
'sad'
},
{
username
:
'Chong'
,
mood
:
'sad'
}
]).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
mood
:
'sad'
}).
error
(
function
(
err
)
{
User
.
update
({
mood
:
'happy'
},
{
where
:
{
mood
:
'sad'
}
}).
error
(
function
(
err
)
{
expect
(
err
).
to
.
be
.
instanceOf
(
Error
)
expect
(
beforeHook
).
to
.
be
.
true
expect
(
afterHook
).
to
.
be
.
true
...
...
@@ -3225,7 +3225,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
{
username
:
'Cheech'
,
mood
:
'sad'
},
{
username
:
'Chong'
,
mood
:
'sad'
}
]).
success
(
function
()
{
User
.
update
({
mood
:
'happy'
},
{
mood
:
'sad'
}).
error
(
function
(
err
)
{
User
.
update
({
mood
:
'happy'
},
{
where
:
{
mood
:
'sad'
}
}).
error
(
function
(
err
)
{
expect
(
err
).
to
.
be
.
instanceOf
(
Error
)
expect
(
beforeHook
).
to
.
be
.
true
expect
(
afterHook
).
to
.
be
.
true
...
...
@@ -3610,7 +3610,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
this
.
User
.
bulkCreate
([
{
aNumber
:
1
},
{
aNumber
:
1
},
{
aNumber
:
1
}
]).
success
(
function
()
{
self
.
User
.
update
({
aNumber
:
10
},
{
aNumber
:
1
},
{
individualHooks
:
true
}).
spread
(
function
(
affectedRows
,
records
)
{
self
.
User
.
update
({
aNumber
:
10
},
{
where
:
{
aNumber
:
1
},
individualHooks
:
true
}).
spread
(
function
(
affectedRows
,
records
)
{
records
.
forEach
(
function
(
record
)
{
expect
(
record
.
username
).
to
.
equal
(
'User'
+
record
.
id
)
expect
(
record
.
beforeHookTest
).
to
.
be
.
true
...
...
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