       buffer = project.bufferForPath(null, "<div class='name'><%= User.find(2).full_name %></div>")
       tokenizedBuffer = new TokenizedBuffer(buffer)
       tokenizedBuffer.setGrammar(syntax.selectGrammar('test.erb'))
-      tokenizedBuffer.setVisible(true)
       fullyTokenize(tokenizedBuffer)
 
       {tokens} = tokenizedBuffer.lineForScreenRow(0)

    TokenizedBuffer.prototype.chunkSize = 5
    jasmine.unspy(TokenizedBuffer.prototype, 'tokenizeInBackground')

  fullyTokenize = (tokenizedBuffer) ->
    advanceClock() while tokenizedBuffer.firstInvalidRow()?
    changeHandler?.reset()


    it "returns the correct token (regression)", ->
      buffer = project.bufferForPath('sample.js')
      tokenizedBuffer = new TokenizedBuffer(buffer)
      fullyTokenize(tokenizedBuffer)
      expect(tokenizedBuffer.tokenForPosition([1,0]).scopes).toEqual ["source.js"]
      expect(tokenizedBuffer.tokenForPosition([1,1]).scopes).toEqual ["source.js"]
