         ]).models
         sd: {}
       }
+      sinon.stub _, 'defer'
       Backbone.$ = $
       done()
 
   after ->
+    _.defer.restore()
     benv.teardown()
 
   beforeEach ->

        ]).models
        sd: {}
      }
      Backbone.$ = $
      done()

  after ->
    benv.teardown()

  beforeEach ->

    _.last(Backbone.sync.args)[2].success [fabricate 'post', title: "Retrospect on Andy Foobar"]
    $('body').html().should.include "Retrospect on Andy Foobar"

  it 'renders featured artists'

describe 'HomeAuthRouter', ->

  before (done) ->
    benv.setup => done()

  after ->
    benv.teardown()

  beforeEach ->
    HomeAuthRouter = benv.require '../client/auth_router.coffee'
    HomeAuthRouter.__set__ 'mediator', @mediator = { trigger: sinon.stub() }
    @router = new HomeAuthRouter

  it 'on login opens the login modal', ->
    @router.login()
    @mediator.trigger.args[0][0].should.equal 'open:auth'
    @mediator.trigger.args[0][1].mode.should.equal 'login'

  it 'on signup opens the signup modal', ->
    @router.signup()
    @mediator.trigger.args[0][0].should.equal 'open:auth'
    @mediator.trigger.args[0][1].mode.should.equal 'register'

  it 'on forgot opens the forgot modal', ->
    @router.forgot()
    @mediator.trigger.args[0][0].should.equal 'open:auth'
    @mediator.trigger.args[0][1].mode.should.equal 'forgot'