nit: could you put all the spies and the onHashChange call in a common setup function ?