From c6a81c94eb11150599cd6c1591b65267e4e20e11 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 8 Sep 2015 11:47:43 +0100 Subject: [PATCH] Test the `cacheWarm` option for preview. --- .../acceptence/coffee/SendingFileTest.coffee | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/services/filestore/test/acceptence/coffee/SendingFileTest.coffee b/services/filestore/test/acceptence/coffee/SendingFileTest.coffee index 0b946312d1..28cd4f3f7e 100644 --- a/services/filestore/test/acceptence/coffee/SendingFileTest.coffee +++ b/services/filestore/test/acceptence/coffee/SendingFileTest.coffee @@ -150,3 +150,22 @@ describe "Filestore", -> expect(response.statusCode).to.equal 200 expect(new Buffer(body.substring(0, 8)).toString('hex')).to.equal 'efbfbd504e470d0a1a0a' done() + + describe "warming the cache", -> + + beforeEach -> + @fileUrl = @fileUrl + '?style=preview&cacheWarm=true' + + it "should not time out", (done) -> + @timeout(1000 * 20) + request.get @fileUrl, (err, response, body) => + expect(response).to.not.equal null + done() + + it "should respond with only an 'OK'", (done) -> + # note: this test relies of the imagemagick conversion working + @timeout(1000 * 20) + request.get @fileUrl, (err, response, body) => + expect(response.statusCode).to.equal 200 + body.should.equal 'OK' + done()