Skip to content

Instantly share code, notes, and snippets.

@willwhite
Created January 12, 2011 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willwhite/776385 to your computer and use it in GitHub Desktop.
Save willwhite/776385 to your computer and use it in GitHub Desktop.
module.exports = {
'foo': function() {
assert.response(app, {
url: '/foo',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
data: '{bar: "baz"}'
}, {
status: 200
}, function(res) {}
// nothing yet
);
}
}
app.put('/foo', function(req, res, next) {
console.log(req.body);
});
@dandean
Copy link

dandean commented Jan 13, 2011

If you change "data" to "body" it'll work... I think...

@tj
Copy link

tj commented Jan 13, 2011

oddly I named it "data" for the request, and "body" for the response haha :) go consistency go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment