From 84dfa0f45ed54ee6cdfeb087906d9f27f04cad4a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 24 Sep 2015 17:05:47 +0200 Subject: [PATCH] add custom singapore schema, it is unusual as it is both a city and a country --- helper/labelSchema.json | 4 ++++ test/unit/helper/labelGenerator.js | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/helper/labelSchema.json b/helper/labelSchema.json index 86f01e00..49c96017 100644 --- a/helper/labelSchema.json +++ b/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"] diff --git a/test/unit/helper/labelGenerator.js b/test/unit/helper/labelGenerator.js index 87ba4814..c70f0e50 100644 --- a/test/unit/helper/labelGenerator.js +++ b/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) {