Skip to content
Myr

Added specs for Request#notFound()

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

authored by visionmedia · committed by visionmedia · parent 54fa643 · Browse files · 1 file+35 added−0 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+35 added−0 removed

  • tests:+35 added−0 removed

1 file+35 added−0 removed

modified:spec/spec.request.js+35 added
301 unmodified lines
302 -{ get('/') }.should.throw_error Error, 'fail!'303 end304 end305 end306 307 describe '#notFound()'308 describe 'when accepting "html"'309 describe 'with "helpful 404" enabled'310 it 'should render the not-found page'311 enable('helpful 404')312 get('/', function(){ this.notFound() })313 get('/').body.should.include '<em>404</em> Not Found'314 get('/').status.should.eql 404315 end316 end317 end318 319 describe 'when not accepting "html"'320 describe 'with "helpful 404" enabled'321 it 'should render defaulat 404 status body'322 var headers = { headers: { accept: 'text/plain' }}323 enable('helpful 404')324 get('/', function(){ this.notFound() })325 get('/', headers).body.should.eql 'Not Found'326 get('/', headers).status.should.eql 404327 end328 end329 end330 331 describe 'when "helpful 404" is disabled'332 it 'should render defaulat 404 status body'333 var headers = { headers: { accept: 'text/plain' }}334 enable('helpful 404')335 get('/', function(){ this.notFound() })336 get('/', headers).body.should.eql 'Not Found'337 get('/', headers).status.should.eql 404338 end339 end340 end341 342 end343end