|
|
@ -249,7 +249,7 @@ module.exports.tests.sanitize_details = function(test, common) { |
|
|
|
var valid_values = ['true', true, 1, '1', 'yes', 'y']; |
|
|
|
var valid_values = ['true', true, 1, '1', 'yes', 'y']; |
|
|
|
valid_values.forEach(function(details) { |
|
|
|
valid_values.forEach(function(details) { |
|
|
|
test('valid details param ' + details, function(t) { |
|
|
|
test('valid details param ' + details, function(t) { |
|
|
|
sanitize({ text: 'test', lat: 0, lon: 0, details: details }, function( err, clean ){ |
|
|
|
sanitize({ text: 'test', details: details }, function( err, clean ){ |
|
|
|
t.equal(clean.details, true, 'details set to true'); |
|
|
|
t.equal(clean.details, true, 'details set to true'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -259,7 +259,7 @@ module.exports.tests.sanitize_details = function(test, common) { |
|
|
|
var valid_false_values = ['false', false, 0, '0', 'no', 'n']; |
|
|
|
var valid_false_values = ['false', false, 0, '0', 'no', 'n']; |
|
|
|
valid_false_values.forEach(function(details) { |
|
|
|
valid_false_values.forEach(function(details) { |
|
|
|
test('test setting false explicitly ' + details, function(t) { |
|
|
|
test('test setting false explicitly ' + details, function(t) { |
|
|
|
sanitize({ text: 'test', lat: 0, lon: 0, details: details }, function( err, clean ){ |
|
|
|
sanitize({ text: 'test', details: details }, function( err, clean ){ |
|
|
|
t.equal(clean.details, false, 'details set to false'); |
|
|
|
t.equal(clean.details, false, 'details set to false'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -267,7 +267,7 @@ module.exports.tests.sanitize_details = function(test, common) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
test('test default behavior', function(t) { |
|
|
|
test('test default behavior', function(t) { |
|
|
|
sanitize({ text: 'test', lat: 0, lon: 0 }, function( err, clean ){ |
|
|
|
sanitize({ text: 'test' }, function( err, clean ){ |
|
|
|
t.equal(clean.details, true, 'details set to true'); |
|
|
|
t.equal(clean.details, true, 'details set to true'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|