fix m.route when called from constructor

This commit is contained in:
Leo Horie 2014-10-30 09:57:08 -04:00
parent cf3b77c161
commit 8b952ee5ea
2 changed files with 34 additions and 4 deletions

View file

@ -1570,6 +1570,28 @@ function testMithril(mock) {
})
return value == "foo+bar"
})
test(function() {
mock.requestAnimationFrame.$resolve()
mock.location.search = "?"
var root = mock.document.createElement("div")
var a = {}
a.controller = function() {m.route("/b")}
a.view = function() {return "a"}
var b = {}
b.controller = function() {}
b.view = function(ctrl) {return "b"}
m.route(root, "/a", {
"/a": a,
"/b": b
})
mock.requestAnimationFrame.$resolve()
return root.childNodes[0].nodeValue == "b"
})
//end m.route
//m.prop