allow trailing slash for routes - fixes #2763
This commit is contained in:
parent
8c149d3653
commit
517661a606
3 changed files with 18 additions and 2 deletions
|
|
@ -209,6 +209,23 @@ o.spec("route", function() {
|
|||
)
|
||||
})
|
||||
|
||||
o("keeps trailing / in rest parameterized route", function() {
|
||||
$window.location.href = prefix + "/test/d/"
|
||||
route(root, "/test/:a...", {
|
||||
"/test/:a..." : {
|
||||
view: lock(function(vnode) {
|
||||
return JSON.stringify(route.param()) + " " +
|
||||
JSON.stringify(vnode.attrs) + " " +
|
||||
route.get()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
o(root.firstChild.nodeValue).equals(
|
||||
'{"a":"d/"} {"a":"d/"} /test/d/'
|
||||
)
|
||||
})
|
||||
|
||||
o("handles route with search", function() {
|
||||
$window.location.href = prefix + "/test?a=b&c=d"
|
||||
route(root, "/test", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue