Browse Source

renamed `query` parameter to `venue`

pull/763/head
Stephen Hess 8 years ago
parent
commit
992f2455d5
  1. 2
      sanitizer/_synthesize_analysis.js
  2. 10
      test/unit/sanitizer/_synthesize_analysis.js

2
sanitizer/_synthesize_analysis.js

@ -2,7 +2,7 @@ const _ = require('lodash');
const text_analyzer = require('pelias-text-analyzer'); const text_analyzer = require('pelias-text-analyzer');
const fields = { const fields = {
'query': 'query', 'venue': 'query',
'address': 'address', 'address': 'address',
'neighbourhood': 'neighbourhood', 'neighbourhood': 'neighbourhood',
'borough': 'borough', 'borough': 'borough',

10
test/unit/sanitizer/_synthesize_analysis.js

@ -12,7 +12,7 @@ module.exports.tests.text_parser = function(test, common) {
}}); }});
const raw = { const raw = {
query: ' \t query \t value \t ', venue: ' \t venue \t value \t ',
neighbourhood: ' \t neighbourhood \t value \t ', neighbourhood: ' \t neighbourhood \t value \t ',
borough: ' \t borough \t value \t ', borough: ' \t borough \t value \t ',
locality: ' \t locality \t value \t ', locality: ' \t locality \t value \t ',
@ -26,7 +26,7 @@ module.exports.tests.text_parser = function(test, common) {
const expected_clean = { const expected_clean = {
parsed_text: { parsed_text: {
query: 'query value', query: 'venue value',
neighbourhood: 'neighbourhood value', neighbourhood: 'neighbourhood value',
borough: 'borough value', borough: 'borough value',
city: 'locality value', city: 'locality value',
@ -59,7 +59,7 @@ module.exports.tests.text_parser = function(test, common) {
} }
const raw = { const raw = {
query: getInvalidValue(), venue: getInvalidValue(),
address: getInvalidValue(), address: getInvalidValue(),
neighbourhood: getInvalidValue(), neighbourhood: getInvalidValue(),
borough: getInvalidValue(), borough: getInvalidValue(),
@ -80,7 +80,7 @@ module.exports.tests.text_parser = function(test, common) {
t.deepEquals(clean, expected_clean); t.deepEquals(clean, expected_clean);
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + t.deepEquals(messages.errors, ['at least one of the following fields is required: ' +
'query, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); 'venue, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors');
t.deepEquals(messages.warnings, [], 'no warnings'); t.deepEquals(messages.warnings, [], 'no warnings');
t.end(); t.end();
@ -103,7 +103,7 @@ module.exports.tests.text_parser = function(test, common) {
t.deepEquals(clean, expected_clean); t.deepEquals(clean, expected_clean);
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + t.deepEquals(messages.errors, ['at least one of the following fields is required: ' +
'query, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); 'venue, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors');
t.deepEquals(messages.warnings, [], 'no warnings'); t.deepEquals(messages.warnings, [], 'no warnings');
t.end(); t.end();

Loading…
Cancel
Save