fix negotiator 3.0 change

i'm not sure if this is incorrect. people should use `accepts()`
anyways.
This commit is contained in:
Jonathan Ong 2013-11-08 14:09:52 -08:00
parent f0ecaaff50
commit a129d41cc1
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ describe('ctx.body=', function(){
ctx.body = '<em>hey</em>'; ctx.body = '<em>hey</em>';
assert('text/html; charset=utf-8' == ctx.responseHeader['content-type']); assert('text/html; charset=utf-8' == ctx.responseHeader['content-type']);
ctx.body = { foo: 'bar' }; ctx.body = { foo: 'bar' };
assert('application/json' == ctx.responseHeader['content-type']); assert('application/json' == ctx.responseHeader['content-type']);
}) })
@ -394,7 +394,7 @@ describe('ctx.accepted', function(){
it('should return accepted types', function(){ it('should return accepted types', function(){
var ctx = context(); var ctx = context();
ctx.req.headers.accept = 'application/*;q=0.2, image/jpeg;q=0.8, text/html, text/plain'; ctx.req.headers.accept = 'application/*;q=0.2, image/jpeg;q=0.8, text/html, text/plain';
ctx.accepted.should.eql(['text/plain', 'text/html', 'image/jpeg', 'application/*']); ctx.accepted.should.eql(['text/html', 'text/plain', 'image/jpeg', 'application/*']);
}) })
}) })