mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 23:59:01 +02:00
Fix stub incorrectly overriding top level beforeEach
This commit is contained in:
@@ -11,7 +11,7 @@ describe "FileStoreHandler", ->
|
||||
@fs =
|
||||
createReadStream : sinon.stub()
|
||||
lstat: sinon.stub().callsArgWith(1, null, {
|
||||
isFile:=> @isSafeOnFileSystem
|
||||
isFile:=> true
|
||||
isDirectory:-> return false
|
||||
})
|
||||
@writeStream =
|
||||
@@ -35,7 +35,6 @@ describe "FileStoreHandler", ->
|
||||
describe "uploadFileFromDisk", ->
|
||||
beforeEach ->
|
||||
@request.returns(@writeStream)
|
||||
@isSafeOnFileSystem = true
|
||||
|
||||
it "should create read stream", (done)->
|
||||
@fs.createReadStream.returns
|
||||
@@ -91,8 +90,13 @@ describe "FileStoreHandler", ->
|
||||
done()
|
||||
|
||||
describe "symlink", ->
|
||||
beforeEach ->
|
||||
@fs.lstat = sinon.stub().callsArgWith(1, null, {
|
||||
isFile:=> false
|
||||
isDirectory:-> return false
|
||||
})
|
||||
|
||||
it "should not read file if it is symlink", (done)->
|
||||
@isSafeOnFileSystem = false
|
||||
@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, =>
|
||||
@fs.createReadStream.called.should.equal false
|
||||
done()
|
||||
|
||||
Reference in New Issue
Block a user