more tests

This commit is contained in:
Leo Horie 2016-05-24 23:16:43 -04:00
parent a2c01d1d96
commit e7420e72e1
14 changed files with 596 additions and 215 deletions

View file

@ -38,6 +38,18 @@ o.spec("Router.setPath", function() {
o(router.getPath()).equals("/ö?ö=ö#ö=ö")
})
o("sets route on fallback mode", function() {
$window.location.href = "file://" + prefix + "/test"
router = new Router($window)
router.setPrefix(prefix)
router.defineRoutes({"/test": {data: 1}, "/other/:a/:b...": {data: 2}}, onRouteChange, onFail)
router.setPath("/other/x/y/z?c=d#e=f")
o(router.getPath()).equals("/other/x/y/z?c=d#e=f")
})
o("sets route via pushState/onpopstate", function() {
$window.location.href = prefix + "/test"
router.defineRoutes({"/test": {data: 1}, "/other/:a/:b...": {data: 2}}, onRouteChange, onFail)