build: update example dependencies
[express.git] / test / acceptance / downloads.js
bloba0aa7b75d9f4f4a469b632666925ff18789aa15a
2 var app = require('../../examples/downloads')
3   , request = require('supertest');
5 describe('downloads', function(){
6   describe('GET /', function(){
7     it('should have a link to amazing.txt', function(done){
8       request(app)
9       .get('/')
10       .expect(/href="\/files\/amazing.txt"/, done)
11     })
12   })
14   describe('GET /files/amazing.txt', function(){
15     it('should have a download header', function(done){
16       request(app)
17       .get('/files/amazing.txt')
18       .expect('Content-Disposition', 'attachment; filename="amazing.txt"')
19       .expect(200, done)
20     })
21   })
23   describe('GET /files/missing.txt', function(){
24     it('should respond with 404', function(done){
25       request(app)
26       .get('/files/missing.txt')
27       .expect(404, done)
28     })
29   })