   getEditorView = -> atom.views.getView(atom.workspace.getActiveTextEditor())
 
   beforeEach ->
+    spyOn(SymbolsView::, "setLoading").andCallThrough()
+
     atom.project.setPaths([
       temp.mkdirSync("other-dir-")
       temp.mkdirSync('atom-symbols-view-')

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

      waitsFor ->
        symbolsView.list.children('li').length is 1


      runs ->
        symbolsView = $(getWorkspaceView()).find('.symbols-view').view()

      waitsFor "loading", ->
        symbolsView.setLoading.callCount > 1

      waitsFor ->
        symbolsView.list.children('li').length > 0
