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.

63 lines
1.2 KiB

10 years ago
# invalid path
10 years ago
*Generated: Fri Sep 12 2014 19:16:14 GMT+0100 (BST)*
10 years ago
## Request
```javascript
{
"protocol": "http:",
"host": "localhost",
"method": "GET",
"port": 3100,
10 years ago
"path": "/notexist"
10 years ago
}
```
## Response
```javascript
Status: 404
{
"x-powered-by": "pelias",
"charset": "utf8",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"cache-control": "public,max-age=300",
"content-type": "application/json; charset=utf-8",
"content-length": "35",
"etag": "W/\"23-dfdfa185\"",
10 years ago
"date": "Fri, 12 Sep 2014 18:16:14 GMT",
10 years ago
"connection": "close"
}
```
```javascript
{
"error": "not found: invalid path"
}
```
## Tests
### ✓ should respond in json with server info
```javascript
should.exist json
should.exist json.error
json.error.should.equal 'not found: invalid path'
```
10 years ago
### ✓ content-type header correctly set
```javascript
response.should.have.header 'Content-Type','application/json; charset=utf-8'
```
10 years ago
### ✓ cache-control header correctly set
```javascript
response.should.have.header 'Cache-Control','public,max-age=300'
```
### ✓ not found
```javascript
response.statusCode.should.equal 404
```