Skip to content

Instantly share code, notes, and snippets.

@romanmt
Created June 12, 2011 12:35
Show Gist options
  • Select an option

  • Save romanmt/1021501 to your computer and use it in GitHub Desktop.

Select an option

Save romanmt/1021501 to your computer and use it in GitHub Desktop.
just hangs.
var helper = require('./test_helper.js')
, express = require('express')
, it = helper.it(exports);
var app = express.createServer();
app.post('/calculator/add', function (req, res) {
res.send('5');
});
it('POST /calculator/add with 2,3 returns 5', function (test) {
test.response(app,
{ url : '/calculator/add'
, method : 'POST'
, data : JSON.stringify("1,2")
, headers : {'Content-Type' : "application/json" }},
{ status : 200,
body : "5",
headers : {
'Content-Type': 'application/json' }
});
test.finish();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment