|
|
|
# invalid path
|
|
|
|
|
|
|
|
*Generated: Thu Nov 06 2014 11:44:19 GMT-0500 (EST)*
|
|
|
|
## Request
|
|
|
|
```javascript
|
|
|
|
{
|
|
|
|
"protocol": "http:",
|
|
|
|
"host": "localhost",
|
|
|
|
"method": "GET",
|
|
|
|
"port": 3100,
|
|
|
|
"path": "/notexist"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Response
|
|
|
|
```javascript
|
|
|
|
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": "Thu, 06 Nov 2014 16:44:19 GMT",
|
|
|
|
"connection": "close"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```javascript
|
|
|
|
{
|
|
|
|
"error": "not found: invalid path"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
### ✓ not found
|
|
|
|
```javascript
|
|
|
|
response.statusCode.should.equal 404
|
|
|
|
```
|
|
|
|
|
|
|
|
### ✓ content-type header correctly set
|
|
|
|
```javascript
|
|
|
|
response.should.have.header 'Content-Type','application/json; charset=utf-8'
|
|
|
|
```
|
|
|
|
|
|
|
|
### ✓ cache-control header correctly set
|
|
|
|
```javascript
|
|
|
|
response.should.have.header 'Cache-Control','public,max-age=300'
|
|
|
|
```
|
|
|
|
|
|
|
|
### ✓ should respond in json with server info
|
|
|
|
```javascript
|
|
|
|
should.exist json
|
|
|
|
should.exist json.error
|
|
|
|
json.error.should.equal 'not found: invalid path'
|
|
|
|
```
|
|
|
|
|