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

      resultRemovedSpy = jasmine.createSpy()

      waitsForPromise ->
        atom.workspaceView.open()

      runs ->
        resultsModel.onDidAddResult resultAddedSpy

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

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

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

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

    runs ->
      editor = atom.workspace.getActiveEditor()
      resultsModel = new ResultsModel()

  describe "searching for a pattern", ->
