Skip to content
Myr

fixed a test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent acbf224 · Browse files · 1 file+13 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−13 removed

  • tests:+13 added−13 removed

1 file+13 added−13 removed

modified:test/response.test.js+13 added-13 removed
9 unmodified lines
1011module.exports = {12 'test #send()': function(){13 var app = express.createServer();1414 15 app.get('/html', function(req, res){16 res.send('<p>test</p>', { 'Content-Language': 'en' });17 });18
29 unmodified lines
48 49 app.get('/noargs', function(req, res, next){50 res.send();51 });5252 53 assert.response(app,54 { url: '/html' },55 { body: '<p>test</p>'56 , headers: {57 'Content-Language': 'en'58 , 'Content-Type': 'text/html; charset=utf8'59 }});6060 61 assert.response(app,62 { url: '/json' },63 { body: '{"foo":"bar"}'64 , status: 20165 , headers: {66 'Content-Type': 'application/json'67 , 'X-Foo': 'baz'68 }});6969 70 assert.response(app,71 { url: '/jsonp?callback=test' },72 { body: 'test({"foo":"bar"});'73 , status: 20174 , headers: {75 'Content-Type': 'text/javascript'76 , 'X-Foo': 'baz'77 }});7878 79 assert.response(app,80 { url: '/jsonp?callback=baz' },81 { body: 'baz({"foo":"bar"});'82 , status: 201, headers: {83 'Content-Type': 'text/javascript'84 , 'X-Foo': 'baz'85 }});8686 87 assert.response(app,88 { url: '/jsonp?callback=invalid()[]' },89 { body: 'invalid({"foo":"bar"});'90 , status: 20191 , headers: {92 'Content-Type': 'text/javascript'93 , 'X-Foo': 'baz'94 }});9595 96 assert.response(app,97 { url: '/json?callback=test' },98 { body: '{"foo":"bar"}'99 , status: 201100 , headers: {101 'Content-Type': 'application/json'102 , 'X-Foo': 'baz'103 }});104104 105 assert.response(app,106 { url: '/text' },107 { body: 'wahoo'108 , headers: {109 'Content-Type': 'text/plain'110 , 'X-Foo': 'bar'111 }});112112 113 assert.response(app,114 { url: '/status' },115 { body: 'Not Found'116 , status: 404117 , headers: { 'Content-Type': 'text/plain' }});118118 119 assert.response(app,120 { url: '/error' },121 { body: 'Oh shit!'122 , status: 500123 , headers: {124 'Content-Type': 'text/plain'124 'Content-Type': 'text/plain; charset=utf8'125 , 'Content-Length': '8'126 }});127127 128 assert.response(app,129 { url: '/buffer' },130 { body: 'wahoo!'131 , headers: {132 'Content-Type': 'application/octet-stream'133 , 'Content-Length': '6'134 }});135135 136 assert.response(app,137 { url: '/noargs' },138 { status: 204 }, function(res){139 assert.equal(undefined, res.headers['content-type']);
440 unmodified lines