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 8fdaf157
authored
May 23, 2013
by
Bart Nagel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
that's an xnor operation, not xor
1 parent
cab315a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
spec/dao.validations.spec.js
spec/dao.validations.spec.js
View file @
8fdaf15
...
@@ -319,9 +319,9 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
...
@@ -319,9 +319,9 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
}
}
},
{
},
{
validate
:
{
validate
:
{
xor
:
function
()
{
x
n
or
:
function
()
{
if
((
this
.
field1
===
null
)
===
(
this
.
field2
===
null
))
{
if
((
this
.
field1
===
null
)
===
(
this
.
field2
===
null
))
{
throw
new
Error
(
'xor failed'
);
throw
new
Error
(
'x
n
or failed'
);
}
}
}
}
}
}
...
@@ -330,7 +330,7 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
...
@@ -330,7 +330,7 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
var
failingFoo
=
Foo
.
build
({
field1
:
null
,
field2
:
null
})
var
failingFoo
=
Foo
.
build
({
field1
:
null
,
field2
:
null
})
,
errors
=
failingFoo
.
validate
()
,
errors
=
failingFoo
.
validate
()
expect
(
errors
).
not
.
toBeNull
()
expect
(
errors
).
not
.
toBeNull
()
expect
(
errors
).
toEqual
({
'__model'
:
[
'xor failed'
]
})
expect
(
errors
).
toEqual
({
'__model'
:
[
'x
n
or failed'
]
})
var
successfulFoo
=
Foo
.
build
({
field1
:
33
,
field2
:
null
})
var
successfulFoo
=
Foo
.
build
({
field1
:
33
,
field2
:
null
})
expect
(
successfulFoo
.
validate
()).
toBeNull
()
expect
(
successfulFoo
.
validate
()).
toBeNull
()
...
...
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