initialValue arg
This commit is contained in:
parent
c4c916b1d2
commit
794d32d7d1
2 changed files with 11 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue