       fs.removeSync(filePath) if fs.existsSync(filePath)
 
     it "updates all the rendered lines when the grammar changes", ->
-      editorView.edit(project.openSync(filePath))
+      editorView.edit(atom.project.openSync(filePath))
       expect(editorView.getGrammar().name).toBe 'Plain Text'
       atom.syntax.setGrammarOverrideForPath(filePath, 'source.js')
       editorView.reloadGrammar()

    beforeEach ->
      filePath = atom.project.resolve('git/working-dir/file.txt')
      originalPathText = fs.readFileSync(filePath, 'utf8')
      editorView.edit(project.openSync(filePath))

    afterEach ->
      fs.writeFileSync(filePath, originalPathText)


    describe "when autoscrolling at the end of the document", ->
      it "renders lines properly", ->
        editorView.edit(atom.project.openSync('two-hundred.txt'))
        editorView.attachToDom(heightInLines: 5.5)

        expect(editorView.renderedLines.find('.line').length).toBe 8
