 
         gammaDir = findDirectoryContainingText(treeView.roots[0], 'gamma')
         gammaDir.expand()
-        deltaFile = gammaDir.entries.children[2]
+        deltaFile = gammaDir.entries.children[1]
 
         [dragStartEvent, dragEnterEvent, dropEvent] =
             eventHelpers.buildInternalDragEvents(deltaFile, alphaDir.querySelector('.header'), alphaDir)
 
-        runs ->
+        treeView.onDragStart(dragStartEvent)
+        treeView.onDrop(dropEvent)
+        expect(alphaDir.children.length).toBe 2
+
+        waitsFor "directory view contents to refresh", ->
+          findDirectoryContainingText(treeView.roots[0], 'alpha').querySelectorAll('.entry').length > 2
+
+        runs ->
+          expect(findDirectoryContainingText(treeView.roots[0], 'alpha').querySelectorAll('.entry').length).toBe 3
+
+      it "shouldn't update editors with similar file paths", ->
+        deltaFilePath2 = path.join(gammaDirPath, 'delta.txt2')
+        fs.writeFileSync(deltaFilePath2, 'copy')
+
+        waitForWorkspaceOpenEvent ->
+          atom.workspace.open(deltaFilePath)
+
+        waitForWorkspaceOpenEvent ->
+          atom.workspace.open(deltaFilePath2)
+
+        runs ->
+          # Dragging delta.txt onto alphaDir
+          alphaDir = findDirectoryContainingText(treeView.roots[0], 'alpha')
+          alphaDir.expand()
+
+          gammaDir = findDirectoryContainingText(treeView.roots[0], 'gamma')
+          gammaDir.expand()
+          deltaFile = gammaDir.entries.children[1]
+
+          [dragStartEvent, dragEnterEvent, dropEvent] =
+              eventHelpers.buildInternalDragEvents(deltaFile, alphaDir.querySelector('.header'), alphaDir)
+
           treeView.onDragStart(dragStartEvent)
           treeView.onDrop(dropEvent)
           expect(alphaDir.children.length).toBe 2
 
-        waitsFor "directory view contents to refresh", ->
-          findDirectoryContainingText(treeView.roots[0], 'alpha').querySelectorAll('.entry').length > 2
-
-        runs ->
-          expect(findDirectoryContainingText(treeView.roots[0], 'alpha').querySelectorAll('.entry').length).toBe 3
+          editors = atom.workspace.getTextEditors()
+          expect(editors[0].getPath()).toBe deltaFilePath.replace('gamma', 'alpha')
+          expect(editors[1].getPath()).toBe deltaFilePath2
 
     describe "when dropping a DirectoryView onto a DirectoryView's header", ->
+      beforeEach ->
+        waitForWorkspaceOpenEvent ->
+          atom.workspace.open(thetaFilePath)
+
       it "should move the directory to the hovered directory", ->
         # Dragging thetaDir onto alphaDir
         alphaDir = findDirectoryContainingText(treeView.roots[0], 'alpha')

              expect(fs.existsSync(filePath)).toBeTruthy()
              expect(callback).not.toHaveBeenCalled()

        describe "when a directory is selected", ->
          it "creates a copy of the original file in the selected directory and removes the original", ->
            LocalStorage['tree-view:cutPath'] = JSON.stringify([filePath])


          describe "when a file or directory already exists at the target path", ->
            it "shows an error message and does not close the dialog", ->
              fs.writeFileSync(path.join(rootDirPath, 'target.txt'), '')
              newPath = path.join(rootDirPath, 'target.txt')
              moveDialog.miniEditor.setText(newPath)

              atom.commands.dispatch moveDialog.element, 'core:confirm'

              expect(moveDialog.errorMessage.textContent).toContain 'already exists'
              expect(moveDialog.element).toHaveClass('error')
              expect(moveDialog.element.parentElement).toBeTruthy()
              expect(callback).not.toHaveBeenCalled()

          describe 'when the file is currently open', ->
            beforeEach ->
              waitForWorkspaceOpenEvent ->
                atom.workspace.open(filePath)

            it 'has its path updated', ->
              newPath = path.join(rootDirPath, 'renamed-test-file.txt')
              moveDialog.miniEditor.setText(path.basename(newPath))

              atom.commands.dispatch moveDialog.element, 'core:confirm'

              expect(atom.workspace.getActiveTextEditor().getPath()).toBe newPath

            it 'does not update paths for similarly-named editors', ->
              filePath2 = path.join(dirPath, 'test-file.txt2')
              fs.writeFileSync(filePath2, 'copy')

              waitForWorkspaceOpenEvent ->
                atom.workspace.open(filePath2)

              runs ->
                newPath = path.join(rootDirPath, 'renamed-test-file.txt')
                moveDialog.miniEditor.setText(path.basename(newPath))

                atom.commands.dispatch moveDialog.element, 'core:confirm'

                editors = atom.workspace.getTextEditors()
                expect(editors[0].getPath()).toBe newPath
                expect(editors[1].getPath()).toBe filePath2

        describe "when 'core:cancel' is triggered on the move dialog", ->
          it "removes the dialog and focuses the tree view", ->
