             it 'replaces the selected characters', ->
               expect(getInputValue().substring 1, 5).to.equal '6/75'
 
+            # TODO: Is this the right behavior?
             it 'moves the cursor to the correct position', ->
-              expect(getInput()._getSelection()).to.eql begin: 6, end: 6
+              expect(getInput()._getSelection()).to.eql begin: 4, end: 4
 
             it 'correctly shifts the mask characters', ->
               expect(getInputValue()).to.equal '16/75/____'

    context "when the mask is 'aaaaaaaa'", ->
      before ->
        mask = 'aaaaaaaa'

      describe 'pressing the enter key', ->
        before ->


    unless defaultPrevented || key.length > 1
      prevVal = getInputValue()
      newVal = prevVal.substring(0, selection.begin) + key + prevVal.substr(selection.end)
      getInput()._setSelection(cursorPos + 1)
      TestUtils.Simulate.change domNode,
        target:
          value: newVal

  simulateKeyDown = (key) ->
    defaultPrevented = false
    TestUtils.Simulate.keyDown(domNode,
      key: key
      preventDefault: -> defaultPrevented = true
    )

    unless defaultPrevented
      {begin, end} = getInput()._getSelection()
      prevVal = getInputValue()
      if begin is end
        if key is 'Backspace'
          newVal = prevVal.substring(0, begin-1) + prevVal.substr(end)
        else if key is 'Delete'
          newVal = prevVal.substring(0, begin) + prevVal.substr(end+1)
      else
        newVal = prevVal.substring(0, begin) + prevVal.substr(end)

      TestUtils.Simulate.change domNode,
        target:
          value: newVal

  simulatePaste = (content) ->
    cursorPos = getInput()._getSelection()
