Browse Source

Compare latitude values only, instead of full sanitiser output

pull/230/head
Julian Simioni 9 years ago
parent
commit
6c1cfbb4ad
  1. 5
      test/unit/sanitiser/search.js

5
test/unit/sanitiser/search.js

@ -103,10 +103,9 @@ module.exports.tests.sanitize_lat = function(test, common) {
test('valid lat', function(t) { test('valid lat', function(t) {
lats.valid.forEach( function( lat ){ lats.valid.forEach( function( lat ){
sanitize({ text: 'test', lat: lat, lon: 0 }, function( err, clean ){ sanitize({ text: 'test', lat: lat, lon: 0 }, function( err, clean ){
var expected = JSON.parse(JSON.stringify( defaultClean )); var expected_lat = parseFloat( lat );
expected.lat = parseFloat( lat );
t.equal(err, undefined, 'no error'); t.equal(err, undefined, 'no error');
t.deepEqual(clean.lat, expected.lat, 'clean lat set correctly (' + lat + ')'); t.deepEqual(clean.lat, expected_lat, 'clean lat set correctly (' + lat + ')');
}); });
}); });
t.end(); t.end();

Loading…
Cancel
Save