       runs ->
         editor = atom.workspace.getActiveEditor()
         editor.setCursorBufferPosition([0,2])
-        atom.commands.dispatch(atom.views.getView(atom.workspace), 'symbols-view:go-to-declaration')
+        atom.commands.dispatch(getEditorView(), 'symbols-view:go-to-declaration')
 
       waitsForPromise ->
         activationPromise

          editor = atom.workspace.getActiveEditor()
          editor.setCursorBufferPosition([8,14])
          spyOn(SymbolsView.prototype, "moveToPosition").andCallThrough()
          atom.commands.dispatch(atom.views.getView(atom.workspace), 'symbols-view:go-to-declaration')

        waitsFor ->
          SymbolsView::moveToPosition.callCount is 1

      runs ->
        atom.workspace.getActiveEditor().setText("var test = function() {}")
        atom.workspace.getActiveEditor().save()
        atom.commands.dispatch(getEditorView(), "symbols-view:toggle-file-symbols")

      waitsForPromise ->
        activationPromise

      waitsFor ->
        $(getWorkspaceView()).find('.symbols-view').view().error.isVisible()

      runs ->
        atom.commands.dispatch(getEditorView(), "symbols-view:toggle-file-symbols")
        atom.workspace.getActiveEditor().setGrammar(atom.syntax.grammarForScopeName('source.js'))
        atom.commands.dispatch(getEditorView(), "symbols-view:toggle-file-symbols")
        symbolsView = $(getWorkspaceView()).find('.symbols-view').view()
        expect(symbolsView.loading).toBeVisible()

      waitsFor ->
