     expect(autocomplete.list.prop('scrollWidth')).toBe autocomplete.list.width()
 
   it "includes completions for the scope's completion preferences", ->
+    cssEditorView = null
+
     waitsForPromise ->
       atom.packages.activatePackage('language-css')
 
+    waitsForPromise ->
+      atom.workspace.open('css.css').then (editor) ->
+        cssEditorView = new EditorView({editor})
+
     runs ->
-      cssEditorView = new EditorView(editor: atom.project.openSync('css.css'))
       cssEditor = cssEditorView.editor
       autocomplete = new AutocompleteView(cssEditorView)
 


  beforeEach ->
    atom.workspaceView = new WorkspaceView
    atom.workspaceView.openSync('sample.js')
    atom.workspaceView.simulateDomAttachment()
    activationPromise = atom.packages.activatePackage('autocomplete')

  describe "@activate()", ->
    it "activates autocomplete on all existing and future editors (but not on autocomplete's own mini editor)", ->

      describe "when `autocomplete.includeCompletionsFromAllBuffers` is true", ->
        it "shows words from all open buffers", ->
          atom.config.set('autocomplete.includeCompletionsFromAllBuffers', true)

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

          runs ->
            editor.getBuffer().insert([10,0] ,"extra:SO:extra")
            editor.setCursorBufferPosition([10,8])
            autocomplete.attach()

            expect(autocomplete.list.find('li').length).toBe 2
            expect(autocomplete.list.find('li:eq(0)')).toHaveText('Some')
            expect(autocomplete.list.find('li:eq(1)')).toHaveText('sort')

      describe 'where many cursors are defined', ->
        it 'autocompletes word when there is only a prefix', ->
