 
       # Create a fresh router
       router = new Router()
-      
-      @expectWasNotRouted = (callback) ->
-        spy = sinon.spy()
-        mediator.subscribe '!router:route', spy
-        link = $('<a>').text('Hello World')
-        callback(link)
-        link.appendTo(document.body).click().remove()
-        expect(spy).was.notCalled()
-        mediator.unsubscribe '!router:route', spy
 
     afterEach ->
       layout.dispose()

      spy = sinon.spy()
      mediator.subscribe '!router:route', spy
      path = '/another/link?foo=bar&baz=qux'
      $('<a>').attr('href', path).text('Hello World')
        .appendTo(document.body)
        .click()
        .remove()
      args = spy.lastCall.args
      passedPath = args[0]
      passedCallback = args[1]

define [
  'jquery'
  'underscore'
  'chaplin/mediator'
  'chaplin/lib/router'
  'chaplin/controllers/controller'
  'chaplin/views/layout'
  'chaplin/views/view'
], ($, _, mediator, Router, Controller, Layout, View) ->
  'use strict'

  describe 'Layout', ->
    # Initialize shared variables
    layout = testController = startupControllerContext = router = null

    createLink = (attributes) ->
      attributes = if _.isObject(attributes) then _.clone(attributes) else {}
      # Yes, this is ugly. We’re doing it because IE8-10 reports an incorrect
      # protocol if the href attribute is set programatically.
      if attributes.href?
        div = document.createElement 'div'
        div.innerHTML = "<a href='#{attributes.href}'>Hello World</a>"
        link = div.firstChild
        delete attributes.href
        $link = $(link)
      else
        $link = $(document.createElement 'a')
      $link.attr attributes

    expectWasNotRouted = (linkAttributes) ->
      spy = sinon.spy()
      mediator.subscribe '!router:route', spy
      $link = createLink linkAttributes
      $link.appendTo(document.body).click().remove()
      expect(spy).was.notCalled()
      mediator.unsubscribe '!router:route', spy

    beforeEach ->
      # Create the layout
