Browse Source

Fix ciao tests

pull/426/head
Diana Shkolnikov 9 years ago committed by Julian Simioni
parent
commit
b3939efb21
  1. 7
      test/ciao/reverse/layers_alias_coarse.coffee
  2. 2
      test/ciao/reverse/layers_invalid.coffee
  3. 2
      test/ciao/reverse/layers_mix_invalid_valid.coffee
  4. 2
      test/ciao/reverse/layers_multiple.coffee
  5. 2
      test/ciao/reverse/layers_single.coffee
  6. 2
      test/ciao/reverse/sources_invalid.coffee
  7. 6
      test/ciao/reverse/sources_layers_invalid_combo.coffee
  8. 7
      test/ciao/search/layers_alias_coarse.coffee
  9. 2
      test/ciao/search/layers_invalid.coffee
  10. 2
      test/ciao/search/layers_mix_invalid_valid.coffee
  11. 2
      test/ciao/search/layers_multiple.coffee
  12. 2
      test/ciao/search/layers_single.coffee
  13. 2
      test/ciao/search/sources_invalid.coffee
  14. 6
      test/ciao/search/sources_layers_invalid_combo.coffee
  15. 4
      test/unit/sanitiser/_sources.js

7
test/ciao/reverse/layers_alias_coarse.coffee

@ -41,10 +41,5 @@ json.geocoding.query.layers.should.eql [ "continent",
"macrohood", "macrohood",
"neighbourhood", "neighbourhood",
"microhood", "microhood",
"disputed", "disputed"
"admin0",
"admin1",
"admin2",
"neighborhood",
"local_admin"
] ]

2
test/ciao/reverse/layers_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,country,region,address,venue,county,locality,admin0,admin1,admin2,neighborhood,local_admin,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ] json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

2
test/ciao/reverse/layers_mix_invalid_valid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,country,region,address,venue,county,locality,admin0,admin1,admin2,neighborhood,local_admin,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ] json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

2
test/ciao/reverse/layers_multiple.coffee

@ -30,4 +30,4 @@ should.not.exist json.geocoding.warnings
#? inputs #? inputs
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["country","admin0","region","admin1"] json.geocoding.query.layers.should.eql ["country","region"]

2
test/ciao/reverse/layers_single.coffee

@ -30,4 +30,4 @@ should.not.exist json.geocoding.warnings
#? inputs #? inputs
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["country","admin0"] json.geocoding.query.layers.should.eql ["country"]

2
test/ciao/reverse/sources_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notasource\' is an invalid sources parameter. Valid options: osm,oa,gn,qs,wof,openstreetmap,openaddresses,geonames,quattroshapes,whosonfirst' ] json.geocoding.errors.should.eql [ '\'notasource\' is an invalid sources parameter. Valid options: osm,oa,gn,wof,openstreetmap,openaddresses,geonames,whosonfirst' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

6
test/ciao/reverse/sources_layers_invalid_combo.coffee

@ -1,6 +1,6 @@
#> sources and layers specified (invalid combo) #> sources and layers specified (invalid combo)
path: '/v1/reverse?point.lat=1&point.lon=2&sources=quattroshapes&layers=address' path: '/v1/reverse?point.lat=1&point.lon=2&sources=whosonfirst&layers=address'
#? 200 ok #? 200 ok
response.statusCode.should.be.equal 400 response.statusCode.should.be.equal 400
@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ 'You have specified both the `sources` and `layers` parameters in a combination that will return no results: the quattroshapes source has nothing in the address layer' ] json.geocoding.errors.should.eql [ 'You have specified both the `sources` and `layers` parameters in a combination that will return no results: the whosonfirst source has nothing in the address layer' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings
@ -32,4 +32,4 @@ should.not.exist json.geocoding.warnings
#? inputs #? inputs
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["address"] json.geocoding.query.layers.should.eql ["address"]
json.geocoding.query.sources.should.eql ["quattroshapes"] json.geocoding.query.sources.should.eql ["whosonfirst"]

7
test/ciao/search/layers_alias_coarse.coffee

@ -42,10 +42,5 @@ json.geocoding.query.layers.should.eql [ "continent",
"macrohood", "macrohood",
"neighbourhood", "neighbourhood",
"microhood", "microhood",
"disputed", "disputed"
"admin0",
"admin1",
"admin2",
"neighborhood",
"local_admin"
] ]

2
test/ciao/search/layers_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,country,region,address,venue,county,locality,admin0,admin1,admin2,neighborhood,local_admin,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ] json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

2
test/ciao/search/layers_mix_invalid_valid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,country,region,address,venue,county,locality,admin0,admin1,admin2,neighborhood,local_admin,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ] json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocountry,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

2
test/ciao/search/layers_multiple.coffee

@ -31,4 +31,4 @@ should.not.exist json.geocoding.warnings
#? inputs #? inputs
json.geocoding.query['text'].should.eql 'a' json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["country","admin0","region","admin1"] json.geocoding.query.layers.should.eql ["country","region"]

2
test/ciao/search/layers_single.coffee

@ -31,4 +31,4 @@ should.not.exist json.geocoding.warnings
#? inputs #? inputs
json.geocoding.query['text'].should.eql 'a' json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["country","admin0"] json.geocoding.query.layers.should.eql ["country"]

2
test/ciao/search/sources_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notasource\' is an invalid sources parameter. Valid options: osm,oa,gn,qs,wof,openstreetmap,openaddresses,geonames,quattroshapes,whosonfirst' ] json.geocoding.errors.should.eql [ '\'notasource\' is an invalid sources parameter. Valid options: osm,oa,gn,wof,openstreetmap,openaddresses,geonames,whosonfirst' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings

6
test/ciao/search/sources_layers_invalid_combo.coffee

@ -1,6 +1,6 @@
#> sources and layers specified (invalid combo) #> sources and layers specified (invalid combo)
path: '/v1/search?text=a&sources=quattroshapes&layers=address' path: '/v1/search?text=a&sources=whosonfirst&layers=address'
#? 200 ok #? 200 ok
response.statusCode.should.be.equal 400 response.statusCode.should.be.equal 400
@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors #? expected errors
should.exist json.geocoding.errors should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ 'You have specified both the `sources` and `layers` parameters in a combination that will return no results: the quattroshapes source has nothing in the address layer' ] json.geocoding.errors.should.eql [ 'You have specified both the `sources` and `layers` parameters in a combination that will return no results: the whosonfirst source has nothing in the address layer' ]
#? expected warnings #? expected warnings
should.not.exist json.geocoding.warnings should.not.exist json.geocoding.warnings
@ -33,5 +33,5 @@ should.not.exist json.geocoding.warnings
json.geocoding.query['text'].should.eql 'a' json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10 json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql ["address"] json.geocoding.query.layers.should.eql ["address"]
json.geocoding.query.sources.should.eql ["quattroshapes"] json.geocoding.query.sources.should.eql ["whosonfirst"]
should.not.exist json.geocoding.query['type'] should.not.exist json.geocoding.query['type']

4
test/unit/sanitiser/_sources.js

@ -29,7 +29,7 @@ module.exports.tests.no_sources = function(test, common) {
}; };
var expected_error = 'sources parameter cannot be an empty string. ' + var expected_error = 'sources parameter cannot be an empty string. ' +
'Valid options: osm,oa,gn,qs,wof,openstreetmap,openaddresses,geonames,quattroshapes,whosonfirst'; 'Valid options: osm,oa,gn,wof,openstreetmap,openaddresses,geonames,whosonfirst';
var messages = sanitize(req.query, req.clean); var messages = sanitize(req.query, req.clean);
@ -104,7 +104,7 @@ module.exports.tests.invalid_sources = function(test, common) {
var expected_messages = { var expected_messages = {
errors: [ errors: [
'\'notasource\' is an invalid sources parameter. ' + '\'notasource\' is an invalid sources parameter. ' +
'Valid options: osm,oa,gn,qs,wof,openstreetmap,openaddresses,geonames,quattroshapes,whosonfirst' 'Valid options: osm,oa,gn,wof,openstreetmap,openaddresses,geonames,whosonfirst'
], ],
warnings: [] warnings: []
}; };

Loading…
Cancel
Save