Browse Source

Merge pull request #331 from pelias/fix_ciao_tests

fix ciao tests
pull/333/head
Peter Johnson a.k.a. insertcoffee 9 years ago
parent
commit
38b53e7264
  1. 15
      test/ciao/reverse/boundary_circle_invalid_radius.coffee
  2. 15
      test/ciao/reverse/boundary_circle_valid_radius.coffee
  3. 6
      test/ciao/search/boundary_circle_invalid_radius.coffee
  4. 2
      test/ciao/search/boundary_circle_missing_lat.coffee
  5. 2
      test/ciao/search/boundary_circle_missing_lon.coffee
  6. 4
      test/ciao/search/sources_multiple.coffee

15
test/ciao/reverse/boundary_circle_invalid_radius.coffee

@ -27,12 +27,13 @@ should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ 'missing param \'boundary.circle.radius\'' ]
#? expected warnings
should.not.exist json.geocoding.warnings
should.exist json.geocoding.warnings
json.geocoding.warnings.should.eql [ 'boundary.circle is currently unsupported' ]
#? inputs
json.geocoding.query['size'].should.eql 10
json.geocoding.query['point.lat'].should.eql 40.744243
json.geocoding.query['point.lon'].should.eql -73.990342
json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
should.not.exist json.geocoding.query['boundary.circle.radius']
# json.geocoding.query['size'].should.eql 10
# json.geocoding.query['point.lat'].should.eql 40.744243
# json.geocoding.query['point.lon'].should.eql -73.990342
# json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
# json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
# should.not.exist json.geocoding.query['boundary.circle.radius']

15
test/ciao/reverse/boundary_circle_valid_radius.coffee

@ -26,12 +26,13 @@ json.features.should.be.instanceof Array
should.not.exist json.geocoding.errors
#? expected warnings
should.not.exist json.geocoding.warnings
should.exist json.geocoding.warnings
json.geocoding.warnings.should.eql [ 'boundary.circle is currently unsupported' ]
#? inputs
json.geocoding.query['size'].should.eql 10
json.geocoding.query['point.lat'].should.eql 40.744243
json.geocoding.query['point.lon'].should.eql -73.990342
json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
json.geocoding.query['boundary.circle.radius'].should.eql 999.9
# json.geocoding.query['size'].should.eql 10
# json.geocoding.query['point.lat'].should.eql 40.744243
# json.geocoding.query['point.lon'].should.eql -73.990342
# json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
# json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
# json.geocoding.query['boundary.circle.radius'].should.eql 999.9

6
test/ciao/search/boundary_circle_invalid_radius.coffee

@ -32,6 +32,6 @@ should.not.exist json.geocoding.warnings
#? inputs
json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10
json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
should.not.exist json.geocoding.query['boundary.circle.radius']
should.not.exist json.geocoding.query['boundary.circle.lat']
should.not.exist json.geocoding.query['boundary.circle.lon']
should.not.exist json.geocoding.query['boundary.circle.radius']

2
test/ciao/search/boundary_circle_missing_lat.coffee

@ -32,6 +32,6 @@ should.not.exist json.geocoding.warnings
#? inputs
json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10
json.geocoding.query['boundary.circle.radius'].should.eql 100
should.not.exist json.geocoding.query['boundary.circle.lat']
should.not.exist json.geocoding.query['boundary.circle.lon']
should.not.exist json.geocoding.query['boundary.circle.radius']

2
test/ciao/search/boundary_circle_missing_lon.coffee

@ -32,6 +32,6 @@ should.not.exist json.geocoding.warnings
#? inputs
json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10
json.geocoding.query['boundary.circle.radius'].should.eql 100
should.not.exist json.geocoding.query['boundary.circle.lat']
should.not.exist json.geocoding.query['boundary.circle.lon']
should.not.exist json.geocoding.query['boundary.circle.radius']

4
test/ciao/search/sources_multiple.coffee

@ -1,10 +1,10 @@
#> sources filter
path: '/v1/search?text=a&sources=openstreetmap,geonames'
path: "/v1/search?text=a&sources=openstreetmap,geonames"
#? 200 ok
response.statusCode.should.be.equal 200
response.should.have.header 'charset', 'utf8'
response.should.have.header "charset", 'utf8'
response.should.have.header 'content-type', 'application/json; charset=utf-8'
#? valid geocoding block

Loading…
Cancel
Save