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 bf48a03e
authored
Aug 23, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Plain Diff
master logic has already been in place. added test
2 parents
f8b20e35
6a831c54
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
test/dao.validations.test.js
test/dao.validations.test.js
View file @
bf48a03
...
@@ -494,5 +494,27 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
...
@@ -494,5 +494,27 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
})
})
})
})
})
})
it
(
'validates enums'
,
function
()
{
var
values
=
[
'value1'
,
'value2'
]
var
Bar
=
this
.
sequelize
.
define
(
'Bar'
+
config
.
rand
(),
{
field
:
{
type
:
Sequelize
.
ENUM
,
values
:
values
,
validate
:
{
isIn
:
[
values
]
}
}
})
var
failingBar
=
Bar
.
build
({
field
:
'value3'
})
failingBar
.
validate
().
success
(
function
(
errors
)
{
expect
(
errors
).
not
.
to
.
be
.
null
expect
(
errors
.
field
).
to
.
have
.
length
(
1
)
expect
(
errors
.
field
[
0
]).
to
.
equal
(
"Unexpected value or invalid argument"
)
})
})
})
})
})
})
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