Created
June 12, 2011 12:35
-
-
Save romanmt/1021501 to your computer and use it in GitHub Desktop.
just hangs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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