fix(deps): update debug to ^4.4.0 (#6313)
[express.git] / test / acceptance / downloads.js
blob6db43b351e4cf053a76bd2da077a669cb4c37701
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)
14 describe('GET /files/notes/groceries.txt', function () {
15 it('should have a download header', function (done) {
16 request(app)
17 .get('/files/notes/groceries.txt')
18 .expect('Content-Disposition', 'attachment; filename="groceries.txt"')
19 .expect(200, done)
23 describe('GET /files/amazing.txt', function(){
24 it('should have a download header', function(done){
25 request(app)
26 .get('/files/amazing.txt')
27 .expect('Content-Disposition', 'attachment; filename="amazing.txt"')
28 .expect(200, done)
32 describe('GET /files/missing.txt', function(){
33 it('should respond with 404', function(done){
34 request(app)
35 .get('/files/missing.txt')
36 .expect(404, done)
40 describe('GET /files/../index.js', function () {
41 it('should respond with 403', function (done) {
42 request(app)
43 .get('/files/../index.js')
44 .expect(403, done)