mirror of https://github.com/pelias/api.git
Peter Johnson
9 years ago
29 changed files with 723 additions and 22 deletions
@ -0,0 +1,36 @@ |
|||||||
|
|
||||||
|
#> focus point |
||||||
|
path: '/v1/autocomplete?text=a&focus.point.lat=foo&focus.point.lon=-73.990342' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'missing param \'focus.point.lat\'' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['text'].should.eql 'a' |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['focus.point.lat'] |
||||||
|
should.not.exist json.geocoding.query['focus.point.lon'] |
@ -0,0 +1,36 @@ |
|||||||
|
|
||||||
|
#> focus point |
||||||
|
path: '/v1/autocomplete?text=a&focus.point.lat=40.744243&focus.point.lon=' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'missing param \'focus.point.lon\'' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['text'].should.eql 'a' |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query['focus.point.lat'].should.eql 40.744243 |
||||||
|
should.not.exist json.geocoding.query['focus.point.lon'] |
@ -0,0 +1,36 @@ |
|||||||
|
|
||||||
|
#> focus point |
||||||
|
path: '/v1/autocomplete?text=a&focus.point.lon=-73.990342' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'missing point param \'focus.point\' requires all of: \'lat\',\'lon\' to be present' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['text'].should.eql 'a' |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['focus.point.lat'] |
||||||
|
should.not.exist json.geocoding.query['focus.point.lon'] |
@ -0,0 +1,36 @@ |
|||||||
|
|
||||||
|
#> focus point |
||||||
|
path: '/v1/autocomplete?text=a&focus.point.lat=40.744243' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'missing point param \'focus.point\' requires all of: \'lat\',\'lon\' to be present' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['text'].should.eql 'a' |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['focus.point.lat'] |
||||||
|
should.not.exist json.geocoding.query['focus.point.lon'] |
@ -0,0 +1,35 @@ |
|||||||
|
|
||||||
|
#> focus point |
||||||
|
path: '/v1/autocomplete?text=a&focus.point.lat=40.744243&focus.point.lon=-73.990342' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['text'].should.eql 'a' |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query['focus.point.lat'].should.eql 40.744243 |
||||||
|
json.geocoding.query['focus.point.lon'].should.eql -73.990342 |
@ -0,0 +1,33 @@ |
|||||||
|
|
||||||
|
#> no params specified |
||||||
|
path: '/v1/autocomplete' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'invalid param \'text\': text length, must be >0' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> basic autocomplete |
||||||
|
path: '/v1/autocomplete?text=' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'invalid param \'text\': text length, must be >0' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
should.not.exist json.geocoding.query['text'] |
||||||
|
json.geocoding.query['size'].should.eql 10 |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> layer alias |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&layers=coarse' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_layers'].should.eql ["admin0","admin1","admin2","neighborhood","locality","local_admin"] |
||||||
|
json.geocoding.query['type'].should.eql ["admin0","admin1","admin2","neighborhood","locality","local_admin"] |
@ -0,0 +1,35 @@ |
|||||||
|
|
||||||
|
#> layer alias |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&layers=notlayer' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: venue,address,country,region,county,locality,localadmin,neighbourhood,coarse' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['types'] |
||||||
|
should.not.exist json.geocoding.query['type'] |
@ -0,0 +1,35 @@ |
|||||||
|
|
||||||
|
#> layer alias |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&layers=country,notlayer' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: venue,address,country,region,county,locality,localadmin,neighbourhood,coarse' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['types'] |
||||||
|
should.not.exist json.geocoding.query['type'] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> layer alias |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&layers=country,region' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_layers'].should.eql ["admin0","admin1"] |
||||||
|
json.geocoding.query['type'].should.eql ["admin0","admin1"] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> layer alias |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&layers=country' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_layers'].should.eql ["admin0"] |
||||||
|
json.geocoding.query['type'].should.eql ["admin0"] |
@ -0,0 +1,33 @@ |
|||||||
|
|
||||||
|
#> accept privacy var |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&private=false' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query['private'].should.eql false |
@ -0,0 +1,33 @@ |
|||||||
|
|
||||||
|
#> accept privacy var |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&private=true' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query['private'].should.eql true |
@ -0,0 +1,35 @@ |
|||||||
|
|
||||||
|
#> sources filter |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&sources=openstreetmap,notasource' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ '\'notasource\' is an invalid sources parameter. Valid options: gn,geonames,oa,openaddresses,qs,quattroshapes,osm,openstreetmap' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
should.not.exist json.geocoding.query['types'] |
||||||
|
should.not.exist json.geocoding.query['type'] |
@ -0,0 +1,36 @@ |
|||||||
|
|
||||||
|
#> sources and layers specified (invalid combo) |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&sources=quattroshapes&layers=address' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected 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.' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_layers'].should.eql ["osmaddress","openaddresses"] |
||||||
|
json.geocoding.query.types['from_sources'].should.eql ["admin0","admin1","admin2","neighborhood","locality","local_admin"] |
||||||
|
should.not.exist json.geocoding.query['type'] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> sources and layers specified |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&sources=openaddresses&layers=address' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_layers'].should.eql ["osmaddress","openaddresses"] |
||||||
|
json.geocoding.query['type'].should.eql ["openaddresses"] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> sources filter |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&sources=openstreetmap,geonames' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_sources'].should.eql ["osmaddress","osmnode","osmway","geoname"] |
||||||
|
json.geocoding.query['type'].should.eql ["osmaddress","osmnode","osmway","geoname"] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> sources filter |
||||||
|
path: '/v1/reverse?point.lat=1&point.lon=2&sources=openstreetmap' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.not.exist json.geocoding.errors |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
json.geocoding.query['size'].should.eql 10 |
||||||
|
json.geocoding.query.types['from_sources'].should.eql ["osmaddress","osmnode","osmway"] |
||||||
|
json.geocoding.query['type'].should.eql ["osmaddress","osmnode","osmway"] |
@ -0,0 +1,34 @@ |
|||||||
|
|
||||||
|
#> basic search |
||||||
|
path: '/v1/search?text=' |
||||||
|
|
||||||
|
#? 200 ok |
||||||
|
response.statusCode.should.be.equal 200 |
||||||
|
response.should.have.header 'charset', 'utf8' |
||||||
|
response.should.have.header 'content-type', 'application/json; charset=utf-8' |
||||||
|
|
||||||
|
#? valid geocoding block |
||||||
|
should.exist json.geocoding |
||||||
|
should.exist json.geocoding.version |
||||||
|
should.exist json.geocoding.attribution |
||||||
|
should.exist json.geocoding.query |
||||||
|
should.exist json.geocoding.engine |
||||||
|
should.exist json.geocoding.engine.name |
||||||
|
should.exist json.geocoding.engine.author |
||||||
|
should.exist json.geocoding.engine.version |
||||||
|
should.exist json.geocoding.timestamp |
||||||
|
|
||||||
|
#? valid geojson |
||||||
|
json.type.should.be.equal 'FeatureCollection' |
||||||
|
json.features.should.be.instanceof Array |
||||||
|
|
||||||
|
#? expected errors |
||||||
|
should.exist json.geocoding.errors |
||||||
|
json.geocoding.errors.should.eql [ 'invalid param \'text\': text length, must be >0' ] |
||||||
|
|
||||||
|
#? expected warnings |
||||||
|
should.not.exist json.geocoding.warnings |
||||||
|
|
||||||
|
#? inputs |
||||||
|
should.not.exist json.geocoding.query['text'] |
||||||
|
json.geocoding.query['size'].should.eql 10 |
Loading…
Reference in new issue