diff --git a/examples/downloads/files/notes/groceries.txt b/examples/downloads/files/notes/groceries.txt new file mode 100644 index 0000000000..fb43877709 --- /dev/null +++ b/examples/downloads/files/notes/groceries.txt @@ -0,0 +1,3 @@ +* milk +* eggs +* bread diff --git a/examples/downloads/index.js b/examples/downloads/index.js index 5f0772697c..9321f3bf95 100644 --- a/examples/downloads/index.js +++ b/examples/downloads/index.js @@ -7,11 +7,12 @@ var path = require('path'); var app = module.exports = express(); app.get('/', function(req, res){ - res.send(''); + res.send('') }); // /files/* is accessed via req.params[0] diff --git a/test/acceptance/downloads.js b/test/acceptance/downloads.js index a0aa7b75d9..ae44388354 100644 --- a/test/acceptance/downloads.js +++ b/test/acceptance/downloads.js @@ -11,6 +11,15 @@ describe('downloads', function(){ }) }) + describe('GET /files/notes/groceries.txt', function () { + it('should have a download header', function (done) { + request(app) + .get('/files/notes/groceries.txt') + .expect('Content-Disposition', 'attachment; filename="groceries.txt"') + .expect(200, done) + }) + }) + describe('GET /files/amazing.txt', function(){ it('should have a download header', function(done){ request(app)