Browse Source

Fix middleware unit tests

pull/426/head
Diana Shkolnikov 9 years ago committed by Julian Simioni
parent
commit
31374b5381
  1. 14
      test/unit/middleware/confidenceScore.js
  2. 22
      test/unit/middleware/localNamingConventions.js

14
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]}
};

22
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 = {},

Loading…
Cancel
Save