spec.plugins.static.js
This file
Path
spec/spec.plugins.static.js
73 lines · 2.5 KiB · JavaScript
Last changed by
Merge branch 'master' of http://github.com/visionmedia/expressGuillermo Rauchbefore adoption8ef6a0b
History of this fileTake it
Closes #88.visionmediabefore adoptionb8f54d6
lines 1–2why, one step back12describe 'Express'Merge branch 'master' of http://github.com/visionmedia/expressGuillermo Rauchbefore adoption8ef6a0b
line 3why, one step back3 describe 'Static'Closes #88.visionmediabefore adoptionb8f54d6
lines 4–7why, one step back4 before5 use(require('express/plugins/static').Static, { path: 'spec/fixtures' })6 end7 Merge branch 'master' of http://github.com/visionmedia/expressGuillermo Rauchbefore adoption8ef6a0b
lines 8–9why, one step back8 // TODO: spec again when JSpec has async support ... mocking out FileReadStream9 // is to much of a hassleCloses #88.visionmediabefore adoptionb8f54d6
line 10why, one step back10 Merge branch 'master' of http://github.com/visionmedia/expressGuillermo Rauchbefore adoption8ef6a0b
lines 11–71why, one step back11 // describe 'GET /public/*'12 // it 'should transfer static files'13 // get('/public/user.json').body.should.include '"name":'14 // end15 // end16 // 17 // describe '#sendfile()'18 // describe 'when the file exists'19 // it 'should throw an InvalidPathError when .. is found'20 // get('/public/*', function(file){21 // this.sendfile(file)22 // })23 // try { get('/public/../foobar') }24 // catch (e) {25 // e.name.should.eql 'InvalidPathError'26 // e.message.should.eql "`spec/fixtures/../foobar' is not a valid path"27 // }28 // end29 // 30 // it 'should transfer the file'31 // get('/public/*', function(file){32 // this.sendfile('spec/fixtures/' + file)33 // })34 // get('/public/user.json').body.should.include '"name":'35 // end36 // 37 // it 'should automatically set the content type based on extension'38 // get('/public/*', function(file){39 // this.sendfile('spec/fixtures/' + file)40 // })41 // get('/public/user.json').headers['content-type'].should.eql 'application/json'42 // end43 // end44 // end45 // 46 // describe '#download()' 47 // describe 'when the file exists'48 // it 'should set attachment filename'49 // get('/report', function(){50 // this.download('report.pdf')51 // return 'foo'52 // })53 // get('/report').headers['content-disposition'].should.eql 'attachment; filename="report.pdf"'54 // end55 // 56 // it 'should transfer the file'57 // get('/public/*', function(file){58 // this.download('spec/fixtures/' + file)59 // })60 // get('/public/user.json').body.should.include '"name":'61 // end62 // 63 // it 'should automatically set the content type based on extension'64 // get('/public/*', function(file){65 // this.download('spec/fixtures/' + file)66 // })67 // get('/public/user.json').headers['content-type'].should.eql 'application/json'68 // end69 // end70 // end71 // Closes #88.visionmediabefore adoptionb8f54d6
lines 72–73why, one step back72 end73end