Merge pull request #1719 from sharelatex/ja-restore-doc-snapshots
Show and restore doc snapshots from admin panel GitOrigin-RevId: 22339644d48a8698df97f7d5fc1eecfaf27c6fab
This commit is contained in:
@@ -51,12 +51,12 @@ describe "EditorController", ->
|
||||
|
||||
describe 'addDoc', ->
|
||||
beforeEach ->
|
||||
@ProjectEntityUpdateHandler.addDoc = sinon.stub().yields(null, @doc, @folder_id)
|
||||
@ProjectEntityUpdateHandler.addDocWithRanges = sinon.stub().yields(null, @doc, @folder_id)
|
||||
@EditorController.addDoc @project_id, @folder_id, @docName, @docLines, @source, @user_id, @callback
|
||||
|
||||
it 'should add the doc using the project entity handler', ->
|
||||
@ProjectEntityUpdateHandler.addDoc
|
||||
.calledWith(@project_id, @folder_id, @docName, @docLines)
|
||||
@ProjectEntityUpdateHandler.addDocWithRanges
|
||||
.calledWith(@project_id, @folder_id, @docName, @docLines, {})
|
||||
.should.equal true
|
||||
|
||||
it 'should send the update out to the users in the project', ->
|
||||
|
||||
@@ -477,7 +477,7 @@ describe 'ProjectEntityUpdateHandler', ->
|
||||
@folder = _id: folder_id, docs: []
|
||||
@newDoc = _id: doc_id
|
||||
@ProjectLocator.findElement = sinon.stub().yields(null, @folder)
|
||||
@ProjectEntityUpdateHandler.addDoc = withoutLock: sinon.stub().yields(null, @newDoc)
|
||||
@ProjectEntityUpdateHandler.addDocWithRanges = withoutLock: sinon.stub().yields(null, @newDoc)
|
||||
|
||||
@ProjectEntityUpdateHandler.upsertDoc project_id, folder_id, @docName, @docLines, @source, userId, @callback
|
||||
|
||||
@@ -487,8 +487,8 @@ describe 'ProjectEntityUpdateHandler', ->
|
||||
.should.equal true
|
||||
|
||||
it 'adds the doc', ->
|
||||
@ProjectEntityUpdateHandler.addDoc.withoutLock
|
||||
.calledWith(project_id, folder_id, @docName, @docLines, userId)
|
||||
@ProjectEntityUpdateHandler.addDocWithRanges.withoutLock
|
||||
.calledWith(project_id, folder_id, @docName, @docLines, {}, userId)
|
||||
.should.equal true
|
||||
|
||||
it 'returns the doc', ->
|
||||
@@ -499,7 +499,7 @@ describe 'ProjectEntityUpdateHandler', ->
|
||||
@folder = _id: folder_id, docs: []
|
||||
@newDoc = _id: doc_id
|
||||
@ProjectLocator.findElement = sinon.stub().yields(null, @folder)
|
||||
@ProjectEntityUpdateHandler.addDoc = withoutLock: sinon.stub().yields(null, @newDoc)
|
||||
@ProjectEntityUpdateHandler.addDocWithRanges = withoutLock: sinon.stub().yields(null, @newDoc)
|
||||
|
||||
@ProjectEntityUpdateHandler.upsertDoc project_id, folder_id, "*" + @docName, @docLines, @source, userId, @callback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user