     beforeEach ->
       editor.setCursorBufferPosition([2,0])
       editor.trigger 'find-and-replace:display-replace'
-      view.findEditor.setText('items')
-      view.replaceEditor.setText('cats')
+      bufferFindAndReplaceView.findEditor.setText('items')
+      bufferFindAndReplaceView.replaceEditor.setText('cats')
 
     describe "replace next", ->
       describe "when core:confirm is triggered", ->
         it "replaces the match after the cursor and selects the next match", ->
-          view.replaceEditor.trigger 'core:confirm'
-          expect(view.resultCounter.text()).toEqual('2 of 5')
+          bufferFindAndReplaceView.replaceEditor.trigger 'core:confirm'
+          expect(bufferFindAndReplaceView.resultCounter.text()).toEqual('2 of 5')
           expect(editor.lineForBufferRow(2)).toBe "    if (cats.length <= 1) return items;"
           expect(editor.getSelectedBufferRange()).toEqual [[2, 33], [2, 38]]
 
       describe "when the replace next button is pressed", ->
         it "replaces the match after the cursor and selects the next match", ->
           $('.find-and-replace .btn-next').click()
-          expect(view.resultCounter.text()).toEqual('2 of 5')
+          expect(bufferFindAndReplaceView.resultCounter.text()).toEqual('2 of 5')
           expect(editor.lineForBufferRow(2)).toBe "    if (cats.length <= 1) return items;"
           expect(editor.getSelectedBufferRange()).toEqual [[2, 33], [2, 38]]
 
       describe "when the 'find-and-replace:replace-next' event is triggered", ->
         it "replaces the match after the cursor and selects the next match", ->
           editor.trigger 'find-and-replace:replace-next'
-          expect(view.resultCounter.text()).toEqual('2 of 5')
+          expect(bufferFindAndReplaceView.resultCounter.text()).toEqual('2 of 5')
           expect(editor.lineForBufferRow(2)).toBe "    if (cats.length <= 1) return items;"
           expect(editor.getSelectedBufferRange()).toEqual [[2, 33], [2, 38]]
 

    rootView.attachToDom()
    editor = rootView.getActiveView()
    pack = atom.activatePackage("find-and-replace")
    view = pack.mainModule.bufferFindAndReplaceView

  describe "when find-and-replace:display-find is triggered", ->
    it "attaches BufferFindAndReplaceView to the root view", ->

RootView = require 'root-view'

describe 'BufferFindAndReplaceView', ->
  [editor, bufferFindAndReplaceView] = []

  beforeEach ->
    window.rootView = new RootView()
