       runs ->
         symbolsView.cancel()
         spyOn(symbolsView, 'generateTags').andCallThrough()
-        atom.workspaceView.getActiveView().trigger "symbols-view:toggle-file-symbols"
+        atom.commands.dispatch(atom.views.getView(atom.workspace), "symbols-view:toggle-file-symbols")
 
       waitsFor ->
         symbolsView.list.children('li').length > 0

        atom.workspace.open("tagged.js")

      runs ->
        expect(atom.workspaceView.find('.symbols-view')).not.toExist()
        atom.workspaceView.trigger "symbols-view:toggle-project-symbols"

      waitsForPromise ->
        activationPromise

      runs ->
        symbolsView = atom.workspaceView.find('.symbols-view').view()
        expect(symbolsView.loading).toBeVisible()

      waitsFor ->

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

      waitsForPromise ->
        activationPromise

      waitsFor ->
        $(atom.views.getView(atom.workspace)).find('.symbols-view').view().error.isVisible()

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

      waitsFor ->
