Permalink
Browse files

Merge branch 'master' of github.com:Baggz/Amanda

  • Loading branch information...
2 parents 85b4a55 + dc0de36 commit 84b51a5348e6b37385718b844e90ae69029d72c1 @Baggz committed Mar 1, 2013
Showing with 7 additions and 2 deletions.
  1. +1 −1 src/engines/json/getProperty.js
  2. +6 −1 tests/json/attributes/required/objects.js
@@ -6,7 +6,7 @@
*/
Validation.prototype.getProperty = function(property, source) {
if (source) {
- return (source[property]) ? source[property] : undefined;
+ return (source[property] !== undefined) ? source[property] : undefined;
} else {
return undefined;
}
@@ -23,6 +23,10 @@ suite('JSON/Attribute/required#objects', function() {
},
surname: {
required: true
+ },
+ age: {
+ required: true,
+ type: 'number'
}
}
}
@@ -41,7 +45,8 @@ suite('JSON/Attribute/required#objects', function() {
jsonSchemaValidator.validate({
user: {
name: 'František',
- surname: 'Hába'
+ surname: 'Hába',
+ age: 0,
}
}, schema, function(error) {
count += 1;

0 comments on commit 84b51a5

Please sign in to comment.