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 99f09f58
authored
Sep 20, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix postgres dao test in regards to Model.update signature change
1 parent
1aaeeada
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
test/postgres/dao.test.js
test/postgres/dao.test.js
View file @
99f09f5
...
...
@@ -297,7 +297,7 @@ if (dialect.match(/^postgres/)) {
expect
(
newUser
.
settings
).
to
.
deep
.
equal
({
created
:
{
test
:
'"value"'
}})
// Check to see if updating an hstore field works
self
.
User
.
update
({
settings
:
{
should
:
'update'
,
to
:
'this'
,
first
:
'place'
}},
newUser
.
identifiers
).
success
(
function
()
{
self
.
User
.
update
({
settings
:
{
should
:
'update'
,
to
:
'this'
,
first
:
'place'
}},
{
where
:
newUser
.
identifiers
}
).
success
(
function
()
{
newUser
.
reload
().
success
(
function
()
{
// Postgres always returns keys in alphabetical order (ascending)
expect
(
newUser
.
settings
).
to
.
deep
.
equal
({
first
:
'place'
,
should
:
'update'
,
to
:
'this'
})
...
...
@@ -315,7 +315,7 @@ if (dialect.match(/^postgres/)) {
.
create
({
username
:
'user'
,
email
:
[
'foo@bar.com'
],
settings
:
{
created
:
{
test
:
'"value"'
}}})
.
success
(
function
(
oldUser
)
{
// Update the user and check that the returned object's fields have been parsed by the hstore library
self
.
User
.
update
({
settings
:
{
should
:
'update'
,
to
:
'this'
,
first
:
'place'
}},
oldUser
.
identifiers
,
{
returning
:
true
}).
spread
(
function
(
count
,
users
)
{
self
.
User
.
update
({
settings
:
{
should
:
'update'
,
to
:
'this'
,
first
:
'place'
}},
{
where
:
oldUser
.
identifiers
,
returning
:
true
}).
spread
(
function
(
count
,
users
)
{
expect
(
count
).
to
.
equal
(
1
);
expect
(
users
[
0
].
settings
).
to
.
deep
.
equal
({
should
:
'update'
,
to
:
'this'
,
first
:
'place'
})
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