 
   describe "when no line number has been entered", ->
     it "closes the view and does not update the cursor position", ->
-      editorView.trigger 'go-to-line:toggle'
+      atom.commands.dispatch editorView, 'go-to-line:toggle'
       expect(goToLine.panel.isVisible()).toBeTruthy()
       goToLine.miniEditor.trigger 'core:confirm'
       expect(goToLine.panel.isVisible()).toBeFalsy()


  describe "when entering a line number greater than the number in the buffer", ->
    it "moves the cursor position to the first character of the last line", ->
      editorView.trigger 'go-to-line:toggle'
      expect(goToLine.panel.isVisible()).toBeTruthy()
      expect(goToLine.miniEditor.getText()).toBe ''
      goToLine.miniEditor.getModel().insertText '14'


  describe "when entering a column number greater than the number in the specified line", ->
    it "moves the cursor position to the last character of the specified line", ->
      atom.commands.dispatch editorView, 'go-to-line:toggle'
      expect(goToLine.panel.isVisible()).toBeTruthy()
      expect(goToLine.miniEditor.getText()).toBe ''
      goToLine.miniEditor.getModel().insertText '3:43'
