           atom.workspace.open('sample.js')
 
         runs ->
-          view = atom.workspaceView.find('.indentation-indicator')
-          expect(view.text()).toBe 'Spaces: 6'
+          expect(indicator.text()).toBe 'Spaces: 6'
 
   describe '.deactivate', ->
     it 'removes the indicator view', ->
-      view = atom.workspaceView.find('.indentation-indicator')
-      expect(view).toExist()
+      expect(indicator).toExist()
 
       atom.packages.deactivatePackage('indentation-indicator')
 
-      view = atom.workspaceView.find('.indentation-indicator')
-      expect(view).not.toExist()
+      indicator = atom.workspaceView.find('.indentation-indicator')
+      expect(indicator).not.toExist()
 
     it 'can be executed twice', ->
       atom.packages.deactivatePackage('indentation-indicator')

        atom.workspace.open('sample.js')

      runs ->
        view = atom.workspaceView.find('.indentation-indicator')
        expect(view.text()).toBe 'Spaces:2'

    describe 'when spaceAfterColon is true', ->
      it 'has a space after the colon in the indicator', ->

        atom.workspace.open('sample.js')

      runs ->
        expect(indicator.text()).toBe 'Spaces:6'

    it 'uses the defaults if no editor settings are available', ->
      atom.config.set('editor', {})
