mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 03:17:18 +00:00
Add an acceptance test for using range header when getting a file.
This commit is contained in:
parent
ed980a21e1
commit
959191ae50
1 changed files with 21 additions and 4 deletions
|
@ -32,7 +32,7 @@ describe "Filestore", ->
|
|||
|
||||
|
||||
it "should send a 200 for status endpoing", (done)->
|
||||
request "#{@filestoreUrl}/status", (err, response, body)->
|
||||
request "#{@filestoreUrl}/status", (err, response, body)->
|
||||
response.statusCode.should.equal 200
|
||||
body.indexOf("filestore").should.not.equal -1
|
||||
body.indexOf("up").should.not.equal -1
|
||||
|
@ -56,6 +56,26 @@ describe "Filestore", ->
|
|||
body.should.equal @constantFileContent
|
||||
done()
|
||||
|
||||
it "should be able to get back the first 8 bytes of the file", (done) ->
|
||||
@timeout(1000 * 10)
|
||||
options =
|
||||
uri: @fileUrl
|
||||
headers:
|
||||
'Range': 'bytes=0-8'
|
||||
request.get options, (err, response, body)=>
|
||||
body.should.equal 'hello wor'
|
||||
done()
|
||||
|
||||
it "should be able to get back bytes 4 through 10 of the file", (done) ->
|
||||
@timeout(1000 * 10)
|
||||
options =
|
||||
uri: @fileUrl
|
||||
headers:
|
||||
'Range': 'bytes=4-10'
|
||||
request.get options, (err, response, body)=>
|
||||
body.should.equal 'o world'
|
||||
done()
|
||||
|
||||
it "should be able to delete the file", (done)->
|
||||
@timeout(1000 * 20)
|
||||
request.del @fileUrl, (err, response, body)=>
|
||||
|
@ -84,6 +104,3 @@ describe "Filestore", ->
|
|||
request.get newFileUrl, (err, response, body)=>
|
||||
body.should.equal @constantFileContent
|
||||
done()
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue