Browse Source

Update tests and fixtures

pull/457/head
Diana Shkolnikov 9 years ago
parent
commit
74467e91e6
  1. 2
      test/unit/fixture/dedupe_elasticsearch_nonascii_results.js
  2. 22
      test/unit/fixture/dedupe_elasticsearch_results.js
  3. 6
      test/unit/fixture/search_full_address.js
  4. 4
      test/unit/fixture/search_regions_address.js
  5. 4
      test/unit/middleware/localNamingConventions.js

2
test/unit/fixture/dedupe_elasticsearch_nonascii_results.js

@ -55,7 +55,7 @@ module.exports = [
'name': { 'name': {
'default': '万里加油站' 'default': '万里加油站'
}, },
'address': { 'address_parts': {
'street': 'S308', 'street': 'S308',
'postalcode': '312044' 'postalcode': '312044'
}, },

22
test/unit/fixture/dedupe_elasticsearch_results.js

@ -4,7 +4,7 @@ module.exports = [
'lon': -76.207456, 'lon': -76.207456,
'lat': 40.039265 'lat': 40.039265
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'localadmin': ['East Lampeter'], 'localadmin': ['East Lampeter'],
'region_a': ['PA'], 'region_a': ['PA'],
@ -31,7 +31,7 @@ module.exports = [
'lon': -76.207456, 'lon': -76.207456,
'lat': 40.039265 'lat': 40.039265
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'localadmin': ['East Lampeter'], 'localadmin': ['East Lampeter'],
'region_a': ['PA'], 'region_a': ['PA'],
@ -58,7 +58,7 @@ module.exports = [
'lon': -76.23246, 'lon': -76.23246,
'lat': 39.99288 'lat': 39.99288
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'localadmin': ['West Lampeter'], 'localadmin': ['West Lampeter'],
'region_a': ['PA'], 'region_a': ['PA'],
@ -85,7 +85,7 @@ module.exports = [
'lon': -76.20746, 'lon': -76.20746,
'lat': 40.03927 'lat': 40.03927
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'localadmin': ['East Lampeter'], 'localadmin': ['East Lampeter'],
'region_a': ['PA'], 'region_a': ['PA'],
@ -112,7 +112,7 @@ module.exports = [
'lon': -76.232457, 'lon': -76.232457,
'lat': 39.992877 'lat': 39.992877
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'region': ['Pennsylvania'], 'region': ['Pennsylvania'],
'locality': ['Lampeter'], 'locality': ['Lampeter'],
@ -139,7 +139,7 @@ module.exports = [
'lon': -76.207456, 'lon': -76.207456,
'lat': 40.038987 'lat': 40.038987
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'region': ['Pennsylvania'], 'region': ['Pennsylvania'],
'locality': ['Smoketown'], 'locality': ['Smoketown'],
@ -166,7 +166,7 @@ module.exports = [
'lon': -76.20746, 'lon': -76.20746,
'lat': 40.03899 'lat': 40.03899
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'region': ['Pennsylvania'], 'region': ['Pennsylvania'],
'locality': ['Smoketown'], 'locality': ['Smoketown'],
@ -193,7 +193,7 @@ module.exports = [
'lon': -94.167445, 'lon': -94.167445,
'lat': 38.762788 'lat': 38.762788
}, },
'address': {}, 'address_parts': {},
'parent': { 'parent': {
'region': ['Missouri'], 'region': ['Missouri'],
'locality': ['Strasburg'], 'locality': ['Strasburg'],
@ -219,7 +219,7 @@ module.exports = [
'lon': -78.36317, 'lon': -78.36317,
'lat': 38.98445 'lat': 38.98445
}, },
'address': {}, 'address_parts': {},
'name': { 'name': {
'default': 'Strasburg High School' 'default': 'Strasburg High School'
}, },
@ -245,7 +245,7 @@ module.exports = [
'lon': -100.16516, 'lon': -100.16516,
'lat': 46.13427 'lat': 46.13427
}, },
'address': {}, 'address_parts': {},
'name': { 'name': {
'default': 'Strasburg High School' 'default': 'Strasburg High School'
}, },
@ -271,7 +271,7 @@ module.exports = [
'lon': -81.532392, 'lon': -81.532392,
'lat': 40.597578 'lat': 40.597578
}, },
'address': {}, 'address_parts': {},
'name': { 'name': {
'default': 'Strasburg High School' 'default': 'Strasburg High School'
}, },

6
test/unit/fixture/search_full_address.js

@ -77,7 +77,7 @@ module.exports = {
} }
},{ },{
'match': { 'match': {
'address.number': { 'address_parts.number': {
'query': '123', 'query': '123',
'boost': vs['address:housenumber:boost'], 'boost': vs['address:housenumber:boost'],
'analyzer': vs['address:housenumber:analyzer'] 'analyzer': vs['address:housenumber:analyzer']
@ -85,7 +85,7 @@ module.exports = {
} }
}, { }, {
'match': { 'match': {
'address.street': { 'address_parts.street': {
'query': 'main st', 'query': 'main st',
'boost': vs['address:street:boost'], 'boost': vs['address:street:boost'],
'analyzer': vs['address:street:analyzer'] 'analyzer': vs['address:street:analyzer']
@ -93,7 +93,7 @@ module.exports = {
} }
}, { }, {
'match': { 'match': {
'address.zip': { 'address_parts.zip': {
'query': '10010', 'query': '10010',
'boost': vs['address:postcode:boost'], 'boost': vs['address:postcode:boost'],
'analyzer': vs['address:postcode:analyzer'] 'analyzer': vs['address:postcode:analyzer']

4
test/unit/fixture/search_regions_address.js

@ -77,7 +77,7 @@ module.exports = {
} }
},{ },{
'match': { 'match': {
'address.number': { 'address_parts.number': {
'query': '1', 'query': '1',
'boost': vs['address:housenumber:boost'], 'boost': vs['address:housenumber:boost'],
'analyzer': vs['address:housenumber:analyzer'] 'analyzer': vs['address:housenumber:analyzer']
@ -85,7 +85,7 @@ module.exports = {
} }
}, { }, {
'match': { 'match': {
'address.street': { 'address_parts.street': {
'query': 'water st', 'query': 'water st',
'boost': vs['address:street:boost'], 'boost': vs['address:street:boost'],
'analyzer': vs['address:street:analyzer'] 'analyzer': vs['address:street:analyzer']

4
test/unit/middleware/localNamingConventions.js

@ -10,7 +10,7 @@ module.exports.tests.flipNumberAndStreet = function(test, common) {
'_type': 'test', '_type': 'test',
'name': { 'default': '1 Main St' }, 'name': { 'default': '1 Main St' },
'center_point': { 'lon': -7.131521, 'lat': 54.428866 }, 'center_point': { 'lon': -7.131521, 'lat': 54.428866 },
'address': { 'address_parts': {
'zip': 'BT77 0BG', 'zip': 'BT77 0BG',
'number': '1', 'number': '1',
'street': 'Main St' 'street': 'Main St'
@ -27,7 +27,7 @@ module.exports.tests.flipNumberAndStreet = function(test, common) {
'_type': 'test', '_type': 'test',
'name': { 'default': '23 Grolmanstraße' }, 'name': { 'default': '23 Grolmanstraße' },
'center_point': { 'lon': 13.321487, 'lat': 52.506781 }, 'center_point': { 'lon': 13.321487, 'lat': 52.506781 },
'address': { 'address_parts': {
'zip': '10623', 'zip': '10623',
'number': '23', 'number': '23',
'street': 'Grolmanstraße' 'street': 'Grolmanstraße'

Loading…
Cancel
Save