Skip to content
Myr

Added test for res.contentType() literal

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 5df2544 · Browse files · 1 file+9 added−1 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+9 added−1 removed

  • tests:+9 added−1 removed

1 file+9 added−1 removed

modified:test/response.test.js+9 added-1 removed
152 unmodified lines
153 app.get('/json', function(req, res, next){154 res.contentType('json');155 res.send('{"foo":"bar"}');156 });157 157158 app.get('/literal', function(req, res){159 res.contentType('application/json');160 res.send('{"foo":"bar"}')161 });162163 assert.response(app,164 { url: '/literal' },165 { headers: { 'Content-Type': 'application/json' }}); 166 assert.response(app,167 { url: '/html' },168 { body: '<p>yay</p>', headers: { 'Content-Type': 'text/html' }});169 assert.response(app,170 { url: '/json' },
417 unmodified lines