File tree 3 files changed +18
-5
lines changed
3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ * milk
2
+ * eggs
3
+ * bread
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ var path = require('path');
7
7
var app = module . exports = express ( ) ;
8
8
9
9
app . get ( '/' , function ( req , res ) {
10
- res . send ( '<ul>'
11
- + '<li>Download <a href="/files/amazing.txt">amazing.txt</a>.</li>'
12
- + '<li>Download <a href="/files/missing.txt">missing.txt</a>.</li>'
13
- + '<li>Download <a href="/files/CCTV大赛上海分赛区.txt">CCTV大赛上海分赛区.txt</a>.</li>'
14
- + '</ul>' ) ;
10
+ res . send ( '<ul>' +
11
+ '<li>Download <a href="/files/notes/groceries.txt">notes/groceries.txt</a>.</li>' +
12
+ '<li>Download <a href="/files/amazing.txt">amazing.txt</a>.</li>' +
13
+ '<li>Download <a href="/files/missing.txt">missing.txt</a>.</li>' +
14
+ '<li>Download <a href="/files/CCTV大赛上海分赛区.txt">CCTV大赛上海分赛区.txt</a>.</li>' +
15
+ '</ul>' )
15
16
} ) ;
16
17
17
18
// /files/* is accessed via req.params[0]
Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ describe('downloads', function(){
11
11
} )
12
12
} )
13
13
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 )
20
+ } )
21
+ } )
22
+
14
23
describe ( 'GET /files/amazing.txt' , function ( ) {
15
24
it ( 'should have a download header' , function ( done ) {
16
25
request ( app )
You can’t perform that action at this time.
0 commit comments