Skip to content
Myr

tests: add test for res.sendFile "cacheContol" option

Before adoption: this commit came in with the history the project adopted, so no landing records it.

closes #3061

authored by Zachary Lester · committed by Douglas Christopher Wilson · parent d1d9631 · Browse files · 1 file+20 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−0 removed

  • tests:+20 added−0 removed

1 file+20 added−0 removed

modified:test/res.sendFile.js+20 added
114 unmodified lines
115 var test = request(app).get('/');116 test.expect(200, cb);117 })118119 describe('with "cacheControl" option', function () {120 it('should enable cacheControl by default', function (done) {121 var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'))122123 request(app)124 .get('/')125 .expect('Cache-Control', 'public, max-age=0')126 .expect(200, done)127 })128129 it('should accept cacheControl option', function (done) {130 var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), { cacheControl: false })131132 request(app)133 .get('/')134 .expect(utils.shouldNotHaveHeader('Cache-Control'))135 .expect(200, done)136 })137 })138139 describe('with "dotfiles" option', function () {140 it('should not serve dotfiles by default', function (done) {141 var app = createApp(path.resolve(__dirname, 'fixtures/.name'));142
613 unmodified lines