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 adf9836f
authored
Apr 12, 2012
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for falsy booleans
1 parent
b49c1601
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
spec-jasmine/sqlite/dao-factory.spec.js
spec-jasmine/sqlite/dao-factory.spec.js
View file @
adf9836
...
...
@@ -22,8 +22,9 @@ describe('DAOFactory', function() {
User
=
sequelize
.
define
(
'User'
,
{
age
:
Sequelize
.
INTEGER
,
name
:
Sequelize
.
STRING
,
bio
:
Sequelize
.
TEXT
,
bio
:
Sequelize
.
TEXT
})
Helpers
.
sync
()
})
...
...
@@ -40,7 +41,7 @@ describe('DAOFactory', function() {
it
(
'creates a table entry'
,
function
()
{
Helpers
.
async
(
function
(
done
)
{
User
.
create
({
age
:
21
,
name
:
'John Wayne'
,
bio
:
'noot noot'
}
)
.
create
({
age
:
21
,
name
:
'John Wayne'
,
bio
:
'noot noot'
}
)
.
success
(
done
)
.
error
(
function
(
err
)
{
console
.
log
(
err
)
})
})
...
...
@@ -78,7 +79,7 @@ describe('DAOFactory', function() {
})
})
it
(
'should allow the creation of an object with a boolean as attribute'
,
function
()
{
it
(
'should allow the creation of an object with a boolean
(true)
as attribute'
,
function
()
{
var
Person
=
sequelize
.
define
(
'Person'
,
{
name
:
Sequelize
.
STRING
,
has_swag
:
Sequelize
.
BOOLEAN
...
...
@@ -89,7 +90,6 @@ describe('DAOFactory', function() {
})
Helpers
.
async
(
function
(
done
)
{
var
options
=
JSON
.
stringify
({
foo
:
'bar'
,
bar
:
'foo'
})
Helpers
.
Factories
.
DAO
(
'Person'
,
{
name
:
'John Doe'
,
has_swag
:
true
...
...
@@ -99,6 +99,27 @@ describe('DAOFactory', function() {
})
})
})
it
(
'should allow the creation of an object with a boolean (false) 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
)
{
Helpers
.
Factories
.
DAO
(
'Person'
,
{
name
:
'John Doe'
,
has_swag
:
false
},
function
(
people
)
{
expect
(
people
[
0
].
has_swag
).
toBeFalsy
();
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