         searchPromise
 
       runs ->
-        editor = atom.workspaceView.getActiveView().editor
+        editor = atom.workspace.getActiveEditor()
         editor.setText('items\nitems')
         spyOn(editor, 'scan').andCallThrough()
         advanceClock(editor.buffer.stoppedChangingDelay)

waitsForPromise = (fn) -> window.waitsForPromise timeout: 30000, fn

describe 'ResultsModel', ->
  [editor, searchPromise, resultsModel, searchPromise] = []

  beforeEach ->
    atom.workspaceView = new WorkspaceView()
    atom.project.setPaths([path.join(__dirname, 'fixtures')])

    waitsForPromise ->
      atom.workspace.open('sample.js')

    runs ->
      atom.workspaceView.attachToDom()

      editor = atom.workspaceView.getActiveView()
      editor = editor.editor

      resultsModel = new ResultsModel()

  describe "searching for a pattern", ->

path = require 'path'

ResultsModel = require '../lib/project/results-model'

