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 6825450d
authored
Nov 06, 2014
by
Seth Samuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More promises
1 parent
1007ac22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
test/postgres/dao.test.js
test/postgres/dao.test.js
View file @
6825450
...
@@ -457,38 +457,30 @@ if (dialect.match(/^postgres/)) {
...
@@ -457,38 +457,30 @@ if (dialect.match(/^postgres/)) {
})
})
})
})
it
(
"should read hstore correctly"
,
function
(
done
)
{
it
(
"should read hstore correctly"
,
function
()
{
var
self
=
this
var
self
=
this
var
data
=
{
username
:
'user'
,
email
:
[
'foo@bar.com'
],
settings
:
{
test
:
'"value"'
}}
var
data
=
{
username
:
'user'
,
email
:
[
'foo@bar.com'
],
settings
:
{
test
:
'"value"'
}}
this
.
User
return
this
.
User
.
create
(
data
)
.
create
(
data
)
.
then
(
function
()
{
.
success
(
function
()
{
return
self
.
User
.
find
({
where
:
{
username
:
'user'
}})
})
.
then
(
function
(
user
){
// Check that the hstore fields are the same when retrieving the user
// Check that the hstore fields are the same when retrieving the user
self
.
User
.
find
({
where
:
{
username
:
'user'
}})
expect
(
user
.
settings
).
to
.
deep
.
equal
(
data
.
settings
)
.
success
(
function
(
user
)
{
expect
(
user
.
settings
).
to
.
deep
.
equal
(
data
.
settings
)
done
()
})
})
})
.
error
(
console
.
log
)
})
})
it
(
'should read an hstore array correctly'
,
function
(
done
)
{
it
(
'should read an hstore array correctly'
,
function
()
{
var
self
=
this
var
self
=
this
var
data
=
{
username
:
'user'
,
email
:
[
'foo@bar.com'
],
phones
:
[{
number
:
'123456789'
,
type
:
'mobile'
},
{
number
:
'987654321'
,
type
:
'landline'
}]
}
var
data
=
{
username
:
'user'
,
email
:
[
'foo@bar.com'
],
phones
:
[{
number
:
'123456789'
,
type
:
'mobile'
},
{
number
:
'987654321'
,
type
:
'landline'
}]
}
this
.
User
return
this
.
User
.
create
(
data
)
.
create
(
data
)
.
then
(
function
()
{
.
success
(
function
()
{
// Check that the hstore fields are the same when retrieving the user
// Check that the hstore fields are the same when retrieving the user
self
.
User
.
find
({
where
:
{
username
:
'user'
}})
return
self
.
User
.
find
({
where
:
{
username
:
'user'
}});
.
success
(
function
(
user
)
{
}).
then
(
function
(
user
)
{
expect
(
user
.
phones
).
to
.
deep
.
equal
(
data
.
phones
)
expect
(
user
.
phones
).
to
.
deep
.
equal
(
data
.
phones
)
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