Browse Source

Add two new test entries to test neighbourhood and locality in deduping

pull/444/head
Vesa Meskanen 9 years ago
parent
commit
0064f6f257
  1. 54
      test/unit/fixture/dedupe_elasticsearch_results.js
  2. 2
      test/unit/middleware/dedupe.js

54
test/unit/fixture/dedupe_elasticsearch_results.js

@ -26,6 +26,60 @@ module.exports = [
'_score': 1.2367082,
'confidence': 0.879
},
{ // same as above, but change the neighbourhood
'center_point': {
'lon': -77.207456,
'lat': 41.039265
},
'address': {},
'parent': {
'localadmin': 'East Lampeter',
'region_a': 'PA',
'region': 'Pennsylvania',
'locality': 'Smoketown',
'country_a': 'USA',
'county': 'Lancaster County',
'country': 'United States',
'neighbourhood': 'Blueland' // ###
},
'name': {
'default': 'East Lampeter High School'
},
'category': [
'education'
],
'_id': '357321757',
'_type': 'venue',
'_score': 1.2367082,
'confidence': 0.879
},
{ // same as #1, but change the locality
'center_point': {
'lon': -73.207456,
'lat': 42.039265
},
'address': {},
'parent': {
'localadmin': 'East Lampeter',
'region_a': 'PA',
'region': 'Pennsylvania',
'locality': 'Firetown', // ###
'country_a': 'USA',
'county': 'Lancaster County',
'country': 'United States',
'neighbourhood': 'Greenland'
},
'name': {
'default': 'East Lampeter High School'
},
'category': [
'education'
],
'_id': '357321757',
'_type': 'venue',
'_score': 1.2367082,
'confidence': 0.879
},
{
'center_point': {
'lon': -76.207456,

2
test/unit/middleware/dedupe.js

@ -16,7 +16,7 @@ module.exports.tests.dedupe = function(test, common) {
data: data
};
var expectedCount = 7;
var expectedCount = 9;
dedupe(req, res, function () {
t.equal(res.data.length, expectedCount, 'results have fewer items than before');
t.end();

Loading…
Cancel
Save