make setPath always async

This commit is contained in:
Leo Horie 2016-07-01 13:03:07 -04:00
parent 520d15a060
commit e8e0bae726
10 changed files with 154 additions and 61 deletions

View file

@ -17,6 +17,13 @@ o.spec("Router.defineRoutes", function() {
onFail = o.spy()
})
o("calls onRouteChange on init", function() {
$window.location.href = prefix + "/a"
router.defineRoutes({"/a": {data: 1}}, onRouteChange, onFail)
o(onRouteChange.callCount).equals(1)
})
o("resolves to route", function() {
$window.location.href = prefix + "/test"
router.defineRoutes({"/test": {data: 1}}, onRouteChange, onFail)