Merge pull request #88 from yolk/route-trailing-slash

Added support for trailing slashes in routes
This commit is contained in:
Leo Horie 2014-05-24 13:30:00 -04:00
commit c4e13384db
2 changed files with 18 additions and 3 deletions

View file

@ -579,6 +579,21 @@ function testMithril(mock) {
mock.performance.$elapse(50) //teardown
return root.childNodes[0].nodeValue === "foo bar"
})
test(function() {
mock.performance.$elapse(50) //setup
mock.location.search = "?"
var root = mock.document.createElement("div")
m.route.mode = "search"
m.route(root, "/", {
"/": {controller: function() {}, view: function() {return "foo"}},
"/test11": {controller: function() {}, view: function() {return "bar"}}
})
mock.performance.$elapse(50)
m.route("/test11/")
mock.performance.$elapse(50) //teardown
return mock.location.search == "?/test11/" && root.childNodes[0].nodeValue === "bar"
})
//end m.route
//m.prop