Browse Source

modified warning message for brevity

pull/295/head
Stephen Hess 9 years ago
parent
commit
56d8600218
  1. 2
      sanitiser/_geo_reverse.js
  2. 6
      test/unit/sanitiser/_geo_reverse.js

2
sanitiser/_geo_reverse.js

@ -17,7 +17,7 @@ module.exports = function sanitize( raw, clean ){
}; };
if (['lat', 'lon', 'radius'].some(hasBoundaryCircleField)) { if (['lat', 'lon', 'radius'].some(hasBoundaryCircleField)) {
messages.warnings.push('boundary.circle is currently unsupported and being ignored'); messages.warnings.push('boundary.circle is currently unsupported');
} }
try { try {

6
test/unit/sanitiser/_geo_reverse.js

@ -16,7 +16,7 @@ module.exports.tests.sanitize_boundary_country = function(test, common) {
t.equals(clean['boundary.circle.lat'], 12.121212, 'should be set to point.lat'); t.equals(clean['boundary.circle.lat'], 12.121212, 'should be set to point.lat');
t.deepEquals(errorsAndWarnings, { t.deepEquals(errorsAndWarnings, {
errors: [], errors: [],
warnings: ['boundary.circle is currently unsupported and being ignored'] warnings: ['boundary.circle is currently unsupported']
}, 'no warnings/errors'); }, 'no warnings/errors');
t.end(); t.end();
}); });
@ -33,7 +33,7 @@ module.exports.tests.sanitize_boundary_country = function(test, common) {
t.equals(clean['boundary.circle.lon'], 21.212121, 'should be set to point.lon'); t.equals(clean['boundary.circle.lon'], 21.212121, 'should be set to point.lon');
t.deepEquals(errorsAndWarnings, { t.deepEquals(errorsAndWarnings, {
errors: [], errors: [],
warnings: ['boundary.circle is currently unsupported and being ignored'] warnings: ['boundary.circle is currently unsupported']
}, 'no warnings/errors'); }, 'no warnings/errors');
t.end(); t.end();
}); });
@ -50,7 +50,7 @@ module.exports.tests.sanitize_boundary_country = function(test, common) {
// t.equals(clean['boundary.circle.radius'], 12.121212, 'should be set to point.lat') // t.equals(clean['boundary.circle.radius'], 12.121212, 'should be set to point.lat')
t.deepEquals(errorsAndWarnings, { t.deepEquals(errorsAndWarnings, {
errors: [], errors: [],
warnings: ['boundary.circle is currently unsupported and being ignored'] warnings: ['boundary.circle is currently unsupported']
}, 'no warnings/errors'); }, 'no warnings/errors');
t.end(); t.end();
}); });

Loading…
Cancel
Save