From 170dc661f4914155b9eafef212083c9c1318b232 Mon Sep 17 00:00:00 2001 From: Fabien Franzen Date: Fri, 29 Aug 2014 21:30:42 +0200 Subject: [PATCH] Fix error messages, should be lowercase --- lib/relation-definition.js | 6 +++--- test/relations.test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 29c48f13..540d0dd1 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -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); } diff --git a/test/relations.test.js b/test/relations.test.js index ef212363..7e981ebd 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -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(); });