       spy = sinon.spy(Backbone.history, 'stop')
       expect(router.stopHistory).to.be.a 'function'
       router.stopHistory()
-      expect(Backbone.History.started).to.not.be.ok()
+      expect(Backbone.History.started).to.be false
       expect(spy).was.called()
 
     it 'should have a match method which returns a route', ->

      expect(Backbone.history).to.be.a Backbone.History

    it 'should not start the Backbone.History at once', ->
      expect(Backbone.History.started).to.not.be.ok()

    it 'should allow to start the Backbone.History', ->
      spy = sinon.spy(Backbone.history, 'start')


    it 'should listen to the !router:route event', ->
      path = 'router-route-events'
      routeSpy = sinon.spy router, 'route'
      callback = sinon.spy()
      router.match path, 'router#route'

      mediator.publish '!router:route', path, callback
      expect(routeSpy).was.calledWith path
      expect(callback).was.calledWith true
      expect(route.controller).to.be 'router'
      expect(route.action).to.be 'route'

      callback = sinon.spy()
      mediator.publish '!router:route', 'different-path', callback
      expect(callback).was.calledWith false

      routeSpy.restore()

    it 'should listen to the !router:changeURL event', ->
      path = 'router-changeurl-events'
      changeURL = sinon.spy router, 'changeURL'

      mediator.publish '!router:changeURL', path
      expect(changeURL).was.calledWith path

      changeURL.restore()

    it 'should pass the routing options through', ->
      path = 'router-route-events-options'
      routeSpy = sinon.spy router, 'route'
      callback = sinon.spy()
      router.match path, 'router#route'

      expectedOptions = path: path, replace: true, changeURL: true
      mediator.publish '!router:route', path, replace: true, callback
      expect(routeSpy).was.calledWith path, expectedOptions
      expect(callback).was.calledWith true
      expect(route.controller).to.be 'router'
      expect(route.action).to.be 'route'
      expect(options).to.eql expectedOptions

      routeSpy.restore()

    it 'should forward changeURL routing options to Backbone', ->
      path = 'router-changeurl-options'
      changeURL = sinon.spy router, 'changeURL'
      navigate = sinon.stub Backbone.history, 'navigate'

      options = some: 'stuff'
      mediator.publish '!router:changeURL', path, options
      expect(navigate).was.calledWith path,
        replace: false, trigger: false

      options = replace: true, trigger: true, some: 'stuff'
      mediator.publish '!router:changeURL', path, options
      expect(Backbone.history.navigate).was.calledWith path,
        replace: true, trigger: true

      changeURL.restore()
      navigate.restore()

    it 'should dispose itself correctly', ->
      expect(router.dispose).to.be.a 'function'
