From 31374b5381d37d830222d54c92d818152c7327d8 Mon Sep 17 00:00:00 2001 From: Diana Shkolnikov Date: Mon, 29 Feb 2016 12:54:43 -0500 Subject: [PATCH] Fix middleware unit tests --- test/unit/middleware/confidenceScore.js | 14 +++++++++--- .../unit/middleware/localNamingConventions.js | 22 +++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/test/unit/middleware/confidenceScore.js b/test/unit/middleware/confidenceScore.js index bf454381..7d516f16 100644 --- a/test/unit/middleware/confidenceScore.js +++ b/test/unit/middleware/confidenceScore.js @@ -70,13 +70,21 @@ module.exports.tests.confidenceScore = function(test, common) { value: 1, center_point: { lat: 100.1, lon: -50.5 }, name: { default: 'test name1' }, - admin0: 'country1', admin1: 'state1', admin2: 'city1' + parent: { + country: 'country1', + region: 'state1', + county: 'city1' + } }, { + _score: 20, value: 2, center_point: { lat: 100.2, lon: -51.5 }, name: { default: 'test name2' }, - admin0: 'country2', admin1: 'state2', admin2: 'city2', - _score: 20 + parent: { + country: 'country2', + region: 'state2', + county: 'city2' + } }], meta: {scores: [10]} }; diff --git a/test/unit/middleware/localNamingConventions.js b/test/unit/middleware/localNamingConventions.js index f3c877d0..da904e63 100644 --- a/test/unit/middleware/localNamingConventions.js +++ b/test/unit/middleware/localNamingConventions.js @@ -15,9 +15,11 @@ module.exports.tests.flipNumberAndStreet = function(test, common) { 'number': '1', 'street': 'Main St' }, - 'admin1': 'Dungannon', - 'alpha3': 'GBR', - 'admin0': 'United Kingdom' + 'parent': { + 'region': 'Dungannon', + 'country_a': 'GBR', + 'country': 'United Kingdom' + } }; var deAddress = { @@ -30,12 +32,14 @@ module.exports.tests.flipNumberAndStreet = function(test, common) { 'number': '23', 'street': 'Grolmanstraße' }, - 'admin1': 'Berlin', - 'locality': 'Berlin', - 'alpha3': 'DEU', - 'admin2': 'Berlin', - 'admin0': 'Germany', - 'neighborhood': 'Hansaviertel' + 'parent': { + 'region': 'Berlin', + 'locality': 'Berlin', + 'country_a': 'DEU', + 'county': 'Berlin', + 'country': 'Germany', + 'neighbourhood': 'Hansaviertel' + } }; var req = {},