 					.should.equal true
 
 			it 'should find the root folder', ->
-				@RestoreManager._findFolderOrRootFolderId
+				@RestoreManager._findOrCreateFolder
 					.calledWith(@project_id, "")
 					.should.equal true
 

				@RestoreManager.restoreFileFromV2 @user_id, @project_id, @version, @pathname, @callback

			it 'should find the folder', ->
				@RestoreManager._findFolderOrRootFolderId
					.calledWith(@project_id, "foo")
					.should.equal true


					.calledWith(@user_id, @project_id, @folder_id, 'bar.tex', @fsPath, false)
					.should.equal true

	describe '_findOrCreateFolder', ->
		beforeEach ->
			@EditorController.mkdirp = sinon.stub().yields(null, [], {_id: @folder_id = 'mock-folder-id'})
			@RestoreManager._findOrCreateFolder @project_id, 'folder/name', @callback

		it 'should look up or create the folder', ->
			@EditorController.mkdirp
				.calledWith(@project_id, 'folder/name')
				.should.equal true

		it 'should return the folder_id', ->
			@callback.calledWith(null, @folder_id).should.equal true


	describe '_addEntityWithUniqueName', ->
		beforeEach ->
