       currentParams: Batman
         clear: @clearSpy = createSpy()
         replace: @replaceSpy = createSpy()
+      currentRoute: null
+      currentURL: null
 
     @routeMap = Batman
       routeForParams: ->


mockRoute = ->
  return Batman
    dispatch: createSpy()
    pathFromParams: createSpy()
    paramsFromPath: createSpy()


  @dispatcher.dispatch('/matched/route')

  ok route.dispatch.called

test "dispatch updates the currentRoute on the app", ->
  route = mockRoute()
  @routeMap.routeForParams = -> route

  @dispatcher.dispatch('/matched/route')
  equal @App.get('currentRoute'), route

test "dispatch updates the currentURL on the app", ->
  route = mockRoute()
  @routeMap.routeForParams = -> route

  @dispatcher.dispatch('/matched/route')
  equal @App.get('currentURL'), '/matched/route'

test "dispatch redirects to 404 if no route is found", ->
  Batman.redirect = createSpy()
