 # Mock a router for the context
 beforeEach ->
   sandbox = sinon.sandbox.create()
-  ROUTER  = sandbox.spy()
-  ROUTER.makeHref = sandbox.spy()
-  ROUTER.isActive = sandbox.spy()
-  ROUTER.transitionTo = sandbox.spy()
-  ROUTER.getCurrentPath = sandbox.spy( -> CURRENT_ROUTER_PATH )
-  ROUTER.getCurrentQuery = sandbox.spy( -> CURRENT_ROUTER_QUERY )
-  ROUTER.getCurrentPathname = sandbox.spy( -> '/testing' )
-  ROUTER.getLocation = sandbox.spy( ->
-    addChangeListener: sandbox.spy()
-    removeChangeListener: sandbox.spy()
-  )
-  ROUTER.match = sandbox.spy()
-  ROUTER.getCurrentParams = sandbox.spy( -> CURRENT_ROUTER_PARAMS )
-  ROUTER.transitionTo = sandbox.spy (path, params) ->
-    CURRENT_ROUTER_PARAMS = params
-    CURRENT_ROUTER_PATH = path
+  ROUTER  = {
+    transitionTo:     sandbox.spy()
+    replaceWith:      sandbox.spy()
+    blockTransitions: sandbox.spy()
+    createHref: sandbox.spy( -> '/' )
+  }
 afterEach ->
   sandbox.restore()
 
 # A wrapper component to setup the router context
 Wrapper = React.createClass
   childContextTypes:
-    router: React.PropTypes.func
+    router: React.PropTypes.object
   getChildContext: ->
     router: ROUTER
   render: ->
-    React.createElement(@props._wrapped_component,
-      _.extend(_.omit(@props, '_wrapped_component'), ref: 'element')
+    location = createRouterLocation('/')
+    React.createElement(LocationBroadcast, value: location,
+      React.createElement(@props._wrapped_component,
+        _.extend(_.omit(@props, '_wrapped_component'), ref: 'element')
+      )
     )
 
 Testing = {

  get: -> ROUTER
})

module.exports = {Testing, expect, sinon, React, _, ReactTestUtils}

# No longer exists, needs further investigation if we're using it
# ReactContext   = require('react/lib/ReactContext')

{LocationBroadcast} = require 'react-router/locationBroadcast'
{createRouterLocation} = require 'react-router/LocationUtils'
{Promise}      = require 'es6-promise'
{commonActions} = require './utilities'
sandbox = null
Sinon = {}


ROUTER = null
CURRENT_ROUTER_PARAMS = null
CURRENT_ROUTER_PATH   = null
