initialValue arg

This commit is contained in:
Leo Horie 2016-06-24 15:58:30 -04:00
parent c4c916b1d2
commit 794d32d7d1
2 changed files with 11 additions and 0 deletions

View file

@ -241,6 +241,16 @@ o.spec("xhr", function() {
o(typeof xhr.send).equals("function")
}
})
o("initialValue parameter works", function() {
mock.$defineRoutes({
"GET /items": function() {
return {status: 200, responseText: JSON.stringify([{a: 1}])}
}
})
var items = xhr({method: "GET", url: "/items", initialValue: []})
o(items()).deepEquals([])
})
})
o.spec("failure", function() {
o("rejects on server error", function(done) {