pgte/nock — Issue #12: [recorder] Body is being appended
Author: dscape
Created: 2011-12-01 22:01:17+00:00
State: open

See

```
$ node tests/att/get.js

<<<<<<-- cut here -->>>>>>

nock('nodejsbug.iriscouch.com')
.put('/v061_att_gea')
.reply(201, "{\"ok\":true}\n", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)',
location: 'http://nodejsbug.iriscouch.com/v061_att_gea',
date: 'Thu, 01 Dec 2011 21:39:15 GMT',
'content-type': 'application/json',
'content-length': '12',
'cache-control': 'must-revalidate' });

<<<<<<-- cut here -->>>>>>

<<<<<<-- cut here -->>>>>>

nock('nodejsbug.iriscouch.com')
.put('/v061_att_gea/new/att, "\"Hello\""')
.reply(201, "{\"ok\":true,\"id\":\"new\",\"rev\":\"1-5142a2e74e1ec33e6e5b621418210283\"}\n", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)',
location: 'http://nodejsbug.iriscouch.com/v061_att_gea/new/att',
etag: '"1-5142a2e74e1ec33e6e5b621418210283"',
date: 'Thu, 01 Dec 2011 21:39:16 GMT',
'content-type': 'text/plain;charset=utf-8',
'content-length': '66',
'cache-control': 'must-revalidate' });

<<<<<<-- cut here -->>>>>>

<<<<<<-- cut here -->>>>>>

nock('nodejsbug.iriscouch.com')
.put('/v061_att_gea/new/att?rev=1-5142a2e74e1ec33e6e5b621418210283, "\"Hello\"BM:\u0000\u0000\u0000\u0000\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0000\u0001\u0000\u0000\u0000????\u0001\u0000\u0018\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0013\u000b\u0000\u0000\u0013\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Zm?\u0000"')
.reply(201, "{\"ok\":true,\"id\":\"new\",\"rev\":\"2-3b1f88c637fde74a486cf3ce5558b47e\"}\n", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)',
location: 'http://nodejsbug.iriscouch.com/v061_att_gea/new/att',
etag: '"2-3b1f88c637fde74a486cf3ce5558b47e"',
date: 'Thu, 01 Dec 2011 21:39:16 GMT',
'content-type': 'text/plain;charset=utf-8',
'content-length': '66',
'cache-control': 'must-revalidate' });

<<<<<<-- cut here -->>>>>>

<<<<<<-- cut here -->>>>>>

nock('nodejsbug.iriscouch.com')
.get('/v061_att_gea/new/att?rev=2-3b1f88c637fde74a486cf3ce5558b47e, "\"Hello\"BM:\u0000\u0000\u0000\u0000\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0000\u0001\u0000\u0000\u0000????\u0001\u0000\u0018\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0013\u000b\u0000\u0000\u0013\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Zm?\u0000"')
.reply(200, "BM:\u0000\u0000\u0000\u0000\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0000\u0001\u0000\u0000\u0000ÿÿÿÿ\u0001\u0000\u0018\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0013\u000b\u0000\u0000\u0013\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Zm\u0000", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)',
etag: '"2-3b1f88c637fde74a486cf3ce5558b47e"',
date: 'Thu, 01 Dec 2011 21:39:17 GMT',
'content-type': 'image/bmp',
'content-md5': 'Ow9j2dR0Qm58Qi3z8p2w3A==',
'content-length': '58',
'cache-control': 'must-revalidate',
'accept-ranges': 'bytes' });

<<<<<<-- cut here -->>>>>>

# /Users/dscape/Desktop/dev/nano/tests/att/get.js
ok 1 (unnamed assert)
ok 2 should be equal

1..2
# tests 2
# pass 2

# ok

<<<<<<-- cut here -->>>>>>

nock('nodejsbug.iriscouch.com')
.delete('/v061_att_gea, "\"Hello\"BM:\u0000\u0000\u0000\u0000\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0000\u0001\u0000\u0000\u0000????\u0001\u0000\u0018\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0013\u000b\u0000\u0000\u0013\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Zm?\u0000"')
.reply(200, "{\"ok\":true}\n", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)',
date: 'Thu, 01 Dec 2011 21:39:17 GMT',
'content-type': 'application/json',
'content-length': '12',
'cache-control': 'must-revalidate' });

<<<<<<-- cut here -->>>>>>
```

Strange huh? Body is always appended and always appears even in get requests.