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
){
10 .expect(/href="\/files\/amazing.txt"/, done
)
14 describe('GET /files/notes/groceries.txt', function () {
15 it('should have a download header', function (done
) {
17 .get('/files/notes/groceries.txt')
18 .expect('Content-Disposition', 'attachment; filename="groceries.txt"')
23 describe('GET /files/amazing.txt', function(){
24 it('should have a download header', function(done
){
26 .get('/files/amazing.txt')
27 .expect('Content-Disposition', 'attachment; filename="amazing.txt"')
32 describe('GET /files/missing.txt', function(){
33 it('should respond with 404', function(done
){
35 .get('/files/missing.txt')
40 describe('GET /files/../index.js', function () {
41 it('should respond with 403', function (done
) {
43 .get('/files/../index.js')