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 d85d38ef
authored
Apr 04, 2012
by
Lachèze Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boolean SQLite test (test for ##149)
1 parent
2fa0ddb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
spec-jasmine/sqlite/dao-factory.spec.js
spec-jasmine/sqlite/dao-factory.spec.js
View file @
d85d38e
...
@@ -22,7 +22,8 @@ describe('DAOFactory', function() {
...
@@ -22,7 +22,8 @@ describe('DAOFactory', function() {
User
=
sequelize
.
define
(
'User'
,
{
User
=
sequelize
.
define
(
'User'
,
{
age
:
Sequelize
.
INTEGER
,
age
:
Sequelize
.
INTEGER
,
name
:
Sequelize
.
STRING
,
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
bio
:
Sequelize
.
TEXT
,
is_admin
:
Sequelize
.
BOOLEAN
})
})
Helpers
.
sync
()
Helpers
.
sync
()
})
})
...
@@ -40,7 +41,7 @@ describe('DAOFactory', function() {
...
@@ -40,7 +41,7 @@ describe('DAOFactory', function() {
it
(
'creates a table entry'
,
function
()
{
it
(
'creates a table entry'
,
function
()
{
Helpers
.
async
(
function
(
done
)
{
Helpers
.
async
(
function
(
done
)
{
User
User
.
create
({
age
:
21
,
name
:
'John Wayne'
,
bio
:
'noot noot'
})
.
create
({
age
:
21
,
name
:
'John Wayne'
,
bio
:
'noot noot'
})
.
success
(
done
)
.
success
(
done
)
.
error
(
function
(
err
)
{
console
.
log
(
err
)
})
.
error
(
function
(
err
)
{
console
.
log
(
err
)
})
})
})
...
@@ -77,6 +78,28 @@ describe('DAOFactory', function() {
...
@@ -77,6 +78,28 @@ describe('DAOFactory', function() {
})
})
})
})
})
})
it
(
'should allow the creation of an object with a boolean as attribute'
,
function
()
{
var
Person
=
sequelize
.
define
(
'Person'
,
{
name
:
Sequelize
.
STRING
,
has_swag
:
Sequelize
.
BOOLEAN
})
Helpers
.
async
(
function
(
done
)
{
Person
.
sync
({
force
:
true
}).
success
(
done
)
})
Helpers
.
async
(
function
(
done
)
{
var
options
=
JSON
.
stringify
({
foo
:
'bar'
,
bar
:
'foo'
})
Helpers
.
Factories
.
DAO
(
'Person'
,
{
name
:
'John Doe'
,
has_swag
:
true
},
function
(
people
)
{
expect
(
people
.
has_swag
).
toBeTruthy
()
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