         expect(symbolsView.loadingArea).not.toBeVisible()
 
   it "moves the cursor to the selected function", ->
-    atom.workspaceView.openSync('sample.js')
-    expect(atom.workspaceView.getActivePaneItem().getCursorBufferPosition()).toEqual [0,0]
-    expect(atom.workspaceView.find('.symbols-view')).not.toExist()
-    atom.workspaceView.getActiveView().trigger "symbols-view:toggle-file-symbols"
+    waitsForPromise ->
+      atom.workspace.open('sample.js')
+
+    runs ->
+      expect(atom.workspaceView.getActivePaneItem().getCursorBufferPosition()).toEqual [0,0]
+      expect(atom.workspaceView.find('.symbols-view')).not.toExist()
+      atom.workspaceView.getActiveView().trigger "symbols-view:toggle-file-symbols"
 
     waitsFor ->
       atom.workspaceView.find('.symbols-view').find('li').length

        expect(symbolsView.error).not.toBeVisible()

    it "caches tags until the buffer changes", ->
      editor = atom.workspaceView.openSync('sample.js')
      atom.workspaceView.getActiveView().trigger "symbols-view:toggle-file-symbols"

      waitsForPromise ->
        activationPromise

    describe "when the tag is in a file that doesn't exist", ->
      it "doesn't display the tag", ->
        fs.removeSync(atom.project.resolve("tagged-duplicate.js"))

        waitsForPromise ->
          atom.workspace.open("tagged.js")

        runs ->
          editor = atom.workspaceView.getActivePaneItem()
          editor.setCursorBufferPosition([8,14])
          spyOn(SymbolsView.prototype, "moveToPosition").andCallThrough()
          atom.workspaceView.getActiveView().trigger 'symbols-view:go-to-declaration'

        waitsFor ->
          SymbolsView::moveToPosition.callCount is 1
