diff --git a/helper/outputSchema.json b/helper/outputSchema.json index f7a7540e..30c5283c 100644 --- a/helper/outputSchema.json +++ b/helper/outputSchema.json @@ -1,14 +1,17 @@ { "USA": { "local": ["local_admin", "locality", "neighborhood", "admin2"], - "regional": ["admin1_abbr", "admin1", "admin0"] + "regional": ["admin1_abbr", "admin1"], + "national": ["alpha3", "admin0"] }, "GBR": { - "local": ["neighborhood", "admin2", "local_admin", "locality"], - "regional": ["admin2","admin0","admin1"] + "local": ["neighborhood", "local_admin", "locality"], + "regional": ["admin2", "admin1"], + "national": ["admin0", "alpha3"] }, "default": { "local": ["local_admin", "locality", "neighborhood", "admin2"], - "regional": ["admin1_abbr", "admin1", "admin0"] + "regional": ["admin1_abbr", "admin1"], + "national": ["admin0", "alpha3"] } } \ No newline at end of file diff --git a/test/unit/controller/doc.js b/test/unit/controller/doc.js index 6bf4eaba..ca8f7806 100644 --- a/test/unit/controller/doc.js +++ b/test/unit/controller/doc.js @@ -29,7 +29,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country1', admin1: 'state1', admin2: 'city1', - text: 'test name1, city1, state1' + text: 'test name1, city1, state1, country1' } }, { type: 'Feature', @@ -44,7 +44,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country2', admin1: 'state2', admin2: 'city2', - text: 'test name2, city2, state2' + text: 'test name2, city2, state2, country2' } }]; diff --git a/test/unit/controller/search.js b/test/unit/controller/search.js index 3fc6e1a6..109c2cf1 100644 --- a/test/unit/controller/search.js +++ b/test/unit/controller/search.js @@ -30,7 +30,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country1', admin1: 'state1', admin2: 'city1', - text: 'test name1, city1, state1' + text: 'test name1, city1, state1, country1' } }, { type: 'Feature', @@ -45,7 +45,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country2', admin1: 'state2', admin2: 'city2', - text: 'test name2, city2, state2' + text: 'test name2, city2, state2, country2' } }]; diff --git a/test/unit/controller/suggest.js b/test/unit/controller/suggest.js index aded731b..dbf4ec01 100644 --- a/test/unit/controller/suggest.js +++ b/test/unit/controller/suggest.js @@ -30,7 +30,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country1', admin1: 'state1', admin2: 'city1', - text: 'test name1, city1, state1' + text: 'test name1, city1, state1, country1' } }, { type: 'Feature', @@ -45,7 +45,7 @@ module.exports.tests.functional_success = function(test, common) { admin0: 'country2', admin1: 'state2', admin2: 'city2', - text: 'test name2, city2, state2' + text: 'test name2, city2, state2, country2' } }]; diff --git a/test/unit/helper/geojsonify.js b/test/unit/helper/geojsonify.js index be15acec..adcd19c2 100644 --- a/test/unit/helper/geojsonify.js +++ b/test/unit/helper/geojsonify.js @@ -115,7 +115,7 @@ module.exports.tests.search = function(test, common) { 'properties': { 'id': 'id1', 'layer': 'type1', - 'text': '\'Round Midnight Jazz and Blues Bar, test3, Angel', + 'text': '\'Round Midnight Jazz and Blues Bar, test3, Angel, United Kingdom', 'name': '\'Round Midnight Jazz and Blues Bar', 'alpha3': 'GBR', 'admin0': 'United Kingdom', @@ -139,7 +139,7 @@ module.exports.tests.search = function(test, common) { 'properties': { 'id': 'id2', 'layer': 'type2', - 'text': 'Blues Cafe, test3, Smithfield', + 'text': 'Blues Cafe, test3, Smithfield, United Kingdom', 'name': 'Blues Cafe', 'alpha3': 'GBR', 'admin0': 'United Kingdom', @@ -163,7 +163,7 @@ module.exports.tests.search = function(test, common) { 'properties': { 'id': '34633854', 'layer': 'osmway', - 'text': 'Empire State Building, Manhattan, NY', + 'text': 'Empire State Building, Manhattan, NY, USA', 'name': 'Empire State Building', 'alpha3': 'USA', 'admin0': 'United States', diff --git a/test/unit/helper/outputSchema.js b/test/unit/helper/outputSchema.js index fb2b72af..7e4346db 100644 --- a/test/unit/helper/outputSchema.js +++ b/test/unit/helper/outputSchema.js @@ -13,10 +13,11 @@ module.exports.tests.interface = function(test, common) { }; module.exports.tests.valid = function(test, common) { - var valid_keys = ['local_admin', 'locality', 'neighborhood', 'admin2', 'admin1_abbr', 'admin1', 'admin0']; + var valid_keys = ['local_admin', 'locality', 'neighborhood', 'admin2', 'admin1_abbr', 'admin1', 'admin0', 'alpha3']; var default_schema = { local: ['local_admin', 'locality', 'neighborhood', 'admin2'], - regional: ['admin1_abbr', 'admin1', 'admin0'] + regional: ['admin1_abbr', 'admin1'], + national: ['admin0', 'alpha3'] }; var isValid = function(keys, schema) {