Fix error messages, should be lowercase

This commit is contained in:
Fabien Franzen 2014-08-29 21:30:42 +02:00
parent 7698f0f08b
commit 170dc661f4
2 changed files with 4 additions and 4 deletions

View File

@ -1853,7 +1853,7 @@ RelationDefinition.embedsMany = function embedsMany(modelFrom, modelTo, params)
return ids.indexOf(id) === pos;
});
if (ids.length !== uniqueIds.length) {
this.errors.add(propertyName, 'Contains duplicate `' + idName + '`', 'uniqueness');
this.errors.add(propertyName, 'contains duplicate `' + idName + '`', 'uniqueness');
err(false);
}
}, { code: 'uniqueness' })
@ -1877,7 +1877,7 @@ RelationDefinition.embedsMany = function embedsMany(modelFrom, modelTo, params)
}
} else {
hasErrors = true;
self.errors.add(propertyName, 'Contains invalid item', 'invalid');
self.errors.add(propertyName, 'contains invalid item', 'invalid');
}
});
if (hasErrors) err(false);
@ -2325,7 +2325,7 @@ RelationDefinition.referencesMany = function referencesMany(modelFrom, modelTo,
return ids.indexOf(id) === pos;
});
if (ids.length !== uniqueIds.length) {
var msg = 'Contains duplicate `' + modelTo.modelName + '` instance';
var msg = 'contains duplicate `' + modelTo.modelName + '` instance';
this.errors.add(relationName, msg, 'uniqueness');
err(false);
}

View File

@ -2411,7 +2411,7 @@ describe('relations', function () {
err.name.should.equal('ValidationError');
err.details.codes.jobs.should.eql(['uniqueness']);
var expected = 'The `Category` instance is not valid. ';
expected += 'Details: `jobs` Contains duplicate `Job` instance.';
expected += 'Details: `jobs` contains duplicate `Job` instance.';
err.message.should.equal(expected);
done();
});