                 dirView = treeView.root.entries.find('.directory:contains(test-dir)').view()
                 dirView.expand()
                 expect(dirView.entries.children().length).toBe 1
+                expect(atom.workspace.getActiveEditor().getPath()).toBe(newPath)
 
           describe "when the directories along the new path don't exist", ->
-            it "duplicates the tree", ->
+            it "duplicates the tree and opens the new file", ->
               newPath = path.join(rootDirPath, 'new/directory', 'duplicated-test-file.txt')
               copyDialog.miniEditor.setText(newPath)
 
-              copyDialog.trigger 'core:confirm'
+              waitsForFileToOpen ->
+                copyDialog.trigger 'core:confirm'
 
               waitsFor "tree view to update", ->
                 treeView.root.find('> .entries > .directory:contains(new)').length > 0


        describe "when the path is changed and confirmed", ->
          describe "when all the directories along the new path exist", ->
            it "duplicates the file, updates the tree view, and closes the dialog", ->
              newPath = path.join(rootDirPath, 'duplicated-test-file.txt')
              copyDialog.miniEditor.setText(newPath)

              copyDialog.trigger 'core:confirm'

              waitsFor "tree view to update", ->
                treeView.root.find('> .entries > .file:contains(duplicated-test-file.txt)').length > 0

      sampleTxt = treeView.find('.file:contains(tree-view.txt)')

      expect(treeView.root.directory.getSubscriptionCount()).toBeGreaterThan 0

  afterEach ->
    temp.cleanup()

  describe ".initialize(project)", ->
    it "renders the root of the project and its contents alphabetically with subdirectories first in a collapsed state", ->
