|
|
@ -23,11 +23,12 @@ module.exports.tests.sanitize = function(test, common) { |
|
|
|
var all_required = true; |
|
|
|
var all_required = true; |
|
|
|
|
|
|
|
|
|
|
|
sanitize.sanitize_boundary_circle(clean, params, is_required, all_required); |
|
|
|
sanitize.sanitize_boundary_circle(clean, params, is_required, all_required); |
|
|
|
t.equal(clean.boundary_circle_lat, params['boundary.circle.lat'], 'lat approved'); |
|
|
|
t.equal(clean['boundary.circle.lat'], params['boundary.circle.lat'], 'lat approved'); |
|
|
|
t.equal(clean.boundary_circle_lon, params['boundary.circle.lon'], 'lon approved'); |
|
|
|
t.equal(clean['boundary.circle.lon'], params['boundary.circle.lon'], 'lon approved'); |
|
|
|
t.equal(clean.boundary_circle_radius, params['boundary.circle.radius'], 'radius approved'); |
|
|
|
t.equal(clean['boundary.circle.radius'], params['boundary.circle.radius'], 'radius approved'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
test('valid circle, radius only, all not required', function (t) { |
|
|
|
test('valid circle, radius only, all not required', function (t) { |
|
|
|
var clean = {}; |
|
|
|
var clean = {}; |
|
|
|
var params = { |
|
|
|
var params = { |
|
|
@ -37,7 +38,7 @@ module.exports.tests.sanitize = function(test, common) { |
|
|
|
var all_required = false; |
|
|
|
var all_required = false; |
|
|
|
|
|
|
|
|
|
|
|
sanitize.sanitize_boundary_circle(clean, params, is_required, all_required); |
|
|
|
sanitize.sanitize_boundary_circle(clean, params, is_required, all_required); |
|
|
|
t.equal(clean.boundary_circle_radius, params['boundary.circle.radius'], 'radius approved'); |
|
|
|
t.equal(clean['boundary.circle.radius'], params['boundary.circle.radius'], 'radius approved'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|