You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1.3 KiB

invalid path

Generated: Fri Sep 19 2014 14:38:01 GMT+0100 (BST)

Request

{
  "protocol": "http:",
  "host": "localhost",
  "method": "GET",
  "port": 3100,
  "path": "/notexist"
}

Response

Status: 404
{
  "x-powered-by": "mapzen",
  "charset": "utf8",
  "cache-control": "public,max-age=300",
  "server": "Pelias/0.0.0",
  "access-control-allow-origin": "*",
  "access-control-allow-methods": "GET",
  "access-control-allow-headers": "X-Requested-With,content-type",
  "access-control-allow-credentials": "true",
  "content-type": "application/json; charset=utf-8",
  "content-length": "35",
  "etag": "W/\"23-dfdfa185\"",
  "date": "Fri, 19 Sep 2014 13:38:01 GMT",
  "connection": "close"
}
{
  "error": "not found: invalid path"
}

Tests

✓ cache-control header correctly set

response.should.have.header 'Cache-Control','public,max-age=300'

✓ content-type header correctly set

response.should.have.header 'Content-Type','application/json; charset=utf-8'

✓ not found

response.statusCode.should.equal 404

✓ should respond in json with server info

should.exist json
should.exist json.error
json.error.should.equal 'not found: invalid path'