       { @PersonalizeRouter, init } = mod = rewire '../../client/index'
       mod.__set__ 'Transition', fade: (@fadeStub = sinon.stub())
       mod.__set__ 'views', LocationView: => render: => $el: 'location'
+      mod.__set__ 'Cookies', @Cookies = set: (->), get: (->), expire: (->)
       sinon.spy @PersonalizeRouter::, 'navigate'
       @router = new @PersonalizeRouter user: new CurrentUser
       done()


_ = require 'underscore'
benv = require 'benv'
Backbone = require 'backbone'

    it 'returns the root path if there is no destination cookie set', ->
      @router.redirectLocation().should.equal '/'

    it 'returns the value of the destination cookie if it is present, and clears it', ->
      @Cookies.get = -> '/foo/bar'
      @router.redirectLocation().should.equal '/foo/bar'

  describe '#done', ->
    it 'sets the $el state to loading, saves the user, redirects', ->
