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 a38cea6d
authored
Jul 23, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure that the lovely shortcuts are working
1 parent
f0c019ee
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
spec/dao-factory.spec.js
spec/dao-factory.spec.js
View file @
a38cea6
...
...
@@ -2468,7 +2468,7 @@ describe(Helpers.getTestDialectTeaser("DAOFactory"), function() {
})
})
//- describe: references
describe
(
"
dataset
"
,
function
()
{
describe
(
"
syntax sugar
"
,
function
()
{
before
(
function
(
done
)
{
this
.
User
=
this
.
sequelize
.
define
(
"user"
,
{
username
:
Sequelize
.
STRING
,
...
...
@@ -2479,8 +2479,24 @@ describe(Helpers.getTestDialectTeaser("DAOFactory"), function() {
this
.
User
.
sync
({
force
:
true
}).
success
(
done
)
})
describe
(
"dataset"
,
function
()
{
it
(
"returns a node-sql instance with the correct dialect"
,
function
()
{
expect
(
this
.
User
.
dataset
().
sql
.
dialectName
).
toEqual
(
dialect
)
})
it
(
"allows me to generate sql queries"
,
function
()
{
var
query
=
this
.
User
.
dataset
().
select
(
"username"
).
toQuery
()
expect
(
Object
.
keys
(
query
)).
toEqual
([
'text'
,
'values'
])
})
})
describe
(
"select"
,
function
()
{
it
(
"sets .select() as an alias to .dataset().select()"
,
function
()
{
var
query1
=
this
.
User
.
select
(
"username"
).
toQuery
()
,
query2
=
this
.
User
.
dataset
().
select
(
"username"
).
toQuery
()
expect
(
query1
.
text
).
toEqual
(
query2
.
text
)
})
})
})
})
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