       rootView.trigger 'fuzzy-finder:toggle-file-finder'
 
       waitsFor ->
-        finder.list.children('li').length > 0
-
-      runs ->
-        expect(finder.loadPathsTask.start).toHaveBeenCalled()
-        finder.loadPathsTask.start.reset()
-        rootView.trigger 'fuzzy-finder:toggle-file-finder'
-        rootView.trigger 'fuzzy-finder:toggle-file-finder'
-
-      waitsFor ->
-        finder.list.children('li').length > 0
-
-      runs ->
-        expect(finder.loadPathsTask.start).not.toHaveBeenCalled()
+        finderView.list.children('li').length > 0
+
+      runs ->
+        expect(finderView.loadPathsTask.start).toHaveBeenCalled()
+        finderView.loadPathsTask.start.reset()
+        rootView.trigger 'fuzzy-finder:toggle-file-finder'
+        rootView.trigger 'fuzzy-finder:toggle-file-finder'
+
+      waitsFor ->
+        finderView.list.children('li').length > 0
+
+      runs ->
+        expect(finderView.loadPathsTask.start).not.toHaveBeenCalled()
 
     it "doesn't cache buffer paths", ->
       spyOn(rootView, "getOpenBufferPaths").andCallThrough()
       rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
 
       waitsFor ->
-        finder.list.children('li').length > 0
+        finderView.list.children('li').length > 0
 
       runs ->
         expect(rootView.getOpenBufferPaths).toHaveBeenCalled()

          expect(rootView.find('.fuzzy-finder')).not.toExist()

          rootView.trigger 'fuzzy-finder:toggle-file-finder'
          expect(finder.miniEditor.getText()).toBe ''

        it "shows all relative file paths for the current project and selects the first", ->
          rootView.attachToDom()
          finder.maxItems = Infinity
          rootView.trigger 'fuzzy-finder:toggle-file-finder'
          paths = null
          expect(finder.find(".loading")).toBeVisible()
          expect(finder.find(".loading")).toHaveText "Indexing..."

          waitsFor "all project paths to load", 5000, ->
            if finder.projectPaths?.length > 0
              paths = finder.projectPaths
              true

          runs ->
            expect(finder.list.children('li').length).toBe paths.length
            for path in paths
              expect(finder.list.find("li:contains(#{fs.base(path)})")).toExist()
            expect(finder.list.children().first()).toHaveClass 'selected'
            expect(finder.find(".loading")).not.toBeVisible()

      describe "when root view's project has no path", ->
        beforeEach ->

      rootView.trigger 'fuzzy-finder:toggle-file-finder'

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

      runs ->
        expect(finderView.loadPathsTask.start).toHaveBeenCalled()
        finderView.loadPathsTask.start.reset()
        $(window).trigger 'focus'
        rootView.trigger 'fuzzy-finder:toggle-file-finder'
        rootView.trigger 'fuzzy-finder:toggle-file-finder'
        expect(finderView.loadPathsTask.start).toHaveBeenCalled()

  describe "path ignoring", ->
    it "ignores paths that match entries in config.fuzzyFinder.ignoredNames", ->
      config.set("fuzzyFinder.ignoredNames", ["tree-view.js"])
      rootView.trigger 'fuzzy-finder:toggle-file-finder'
      finderView.maxItems = Infinity

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

      runs ->
        expect(finderView.list.find("li:contains(tree-view.js)")).not.toExist()

  describe "fuzzy find by content under cursor", ->
    editor = null
