@@ -106,6 +106,21 @@ describe('res', function(){
106106 done ( ) ;
107107 } )
108108 } )
109+
110+ it ( 'should include the redirect type' , function ( done ) {
111+ var app = express ( ) ;
112+
113+ app . use ( function ( req , res ) {
114+ res . redirect ( 301 , 'http://google.com' ) ;
115+ } ) ;
116+
117+ request ( app )
118+ . get ( '/' )
119+ . set ( 'Accept' , 'text/html' )
120+ . expect ( 'Content-Type' , / h t m l / )
121+ . expect ( 'Location' , 'http://google.com' )
122+ . expect ( 301 , '<p>Moved Permanently. Redirecting to <a href="http://google.com">http://google.com</a></p>' , done ) ;
123+ } )
109124 } )
110125
111126 describe ( 'when accepting text' , function ( ) {
@@ -143,6 +158,21 @@ describe('res', function(){
143158 done ( ) ;
144159 } )
145160 } )
161+
162+ it ( 'should include the redirect type' , function ( done ) {
163+ var app = express ( ) ;
164+
165+ app . use ( function ( req , res ) {
166+ res . redirect ( 301 , 'http://google.com' ) ;
167+ } ) ;
168+
169+ request ( app )
170+ . get ( '/' )
171+ . set ( 'Accept' , 'text/plain, */*' )
172+ . expect ( 'Content-Type' , / p l a i n / )
173+ . expect ( 'Location' , 'http://google.com' )
174+ . expect ( 301 , 'Moved Permanently. Redirecting to http://google.com' , done ) ;
175+ } )
146176 } )
147177
148178 describe ( 'when accepting neither text or html' , function ( ) {
0 commit comments