Browse Source

add custom singapore schema, it is unusual as it is both a city and a country

pull/301/head
Peter Johnson 9 years ago
parent
commit
84dfa0f45e
  1. 4
      helper/labelSchema.json
  2. 15
      test/unit/helper/labelGenerator.js

4
helper/labelSchema.json

@ -7,6 +7,10 @@
"local": ["neighbourhood", "county", "localadmin", "locality", "region"],
"regional": ["county","country","region"]
},
"SGP": {
"local": ["neighbourhood", "region", "county", "localadmin", "locality"],
"regional": ["county","country","region"]
},
"default": {
"local": ["localadmin", "locality", "neighbourhood", "county"],
"regional": ["region_a", "region", "country"]

15
test/unit/helper/labelGenerator.js

@ -223,6 +223,21 @@ module.exports.tests.new_zealand = function(test, common) {
});
};
// SGP venue
module.exports.tests.singapore_mcdonalds = function(test, common) {
test('singapore_mcdonalds', function(t) {
var doc = {
'name': { 'default': 'McDonald\'s' },
'country_a': 'SGP',
'country': 'Singapore',
'region': 'Central Singapore',
'locality': 'Singapore'
};
t.equal(generator(doc),'McDonald\'s, Central Singapore, Singapore');
t.end();
});
};
module.exports.all = function (tape, common) {
function test(name, testFunction) {

Loading…
Cancel
Save