Просмотр исходного кода

Test the `cacheWarm` option for preview.

Shane Kilkelly 11 лет назад
Родитель
Сommit
c6a81c94eb
1 измененных файлов с 19 добавлено и 0 удалено
  1. 19 0
      services/filestore/test/acceptence/coffee/SendingFileTest.coffee

+ 19 - 0
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()