Merge remote-tracking branch 'origin/rewrite' into rewrite
Conflicts: docs/keys.md docs/signatures.md docs/v1.x-migration.md index.js ospec/bin/ospec.cmd request/request.js request/tests/test-xhr.js util/prop.js util/tests/index.html util/tests/test-prop.js
This commit is contained in:
commit
bce2abbffd
107 changed files with 1989 additions and 1970 deletions
|
|
@ -93,7 +93,7 @@ module.exports = function($window) {
|
|||
|
||||
function interpolate(url, data) {
|
||||
if (data == null) return url
|
||||
|
||||
|
||||
var tokens = url.match(/:[^\/]+/gi) || []
|
||||
for (var i = 0; i < tokens.length; i++) {
|
||||
var key = tokens[i].slice(1)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<script src="../../request/request.js"></script>
|
||||
<script src="test-xhr.js"></script>
|
||||
<script src="test-jsonp.js"></script>
|
||||
|
||||
|
||||
<script>require("../../ospec/ospec").run()</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ o.spec("jsonp", function() {
|
|||
mock = xhrMock()
|
||||
jsonp = new Request(mock).jsonp
|
||||
})
|
||||
|
||||
|
||||
o("works", function(done) {
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
|
|
@ -52,4 +52,4 @@ o.spec("jsonp", function() {
|
|||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ o.spec("xhr", function() {
|
|||
mock = xhrMock()
|
||||
xhr = new Request(mock).xhr
|
||||
})
|
||||
|
||||
|
||||
o.spec("success", function() {
|
||||
o("works via GET", function(done) {
|
||||
var s = new Date
|
||||
|
|
@ -119,7 +119,7 @@ o.spec("xhr", function() {
|
|||
var Entity = function(args) {
|
||||
return {_id: args.id}
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify([{id: 1}, {id: 2}, {id: 3}])}
|
||||
|
|
@ -133,7 +133,7 @@ o.spec("xhr", function() {
|
|||
var Entity = function(args) {
|
||||
return {_id: args.id}
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify({id: 1})}
|
||||
|
|
@ -147,7 +147,7 @@ o.spec("xhr", function() {
|
|||
var serialize = function(data) {
|
||||
return "id=" + data.id
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify({body: request.query})}
|
||||
|
|
@ -161,7 +161,7 @@ o.spec("xhr", function() {
|
|||
var serialize = function(data) {
|
||||
return "id=" + data.id
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"POST /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify({body: request.body})}
|
||||
|
|
@ -175,7 +175,7 @@ o.spec("xhr", function() {
|
|||
var deserialize = function(data) {
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify({test: 123})}
|
||||
|
|
@ -189,7 +189,7 @@ o.spec("xhr", function() {
|
|||
var deserialize = function(data) {
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"POST /item": function(request) {
|
||||
return {status: 200, responseText: JSON.stringify({test: 123})}
|
||||
|
|
@ -203,7 +203,7 @@ o.spec("xhr", function() {
|
|||
var extract = function(data) {
|
||||
return JSON.stringify({test: 123})
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"GET /item": function(request) {
|
||||
return {status: 200, responseText: ""}
|
||||
|
|
@ -217,7 +217,7 @@ o.spec("xhr", function() {
|
|||
var extract = function(data) {
|
||||
return JSON.stringify({test: 123})
|
||||
}
|
||||
|
||||
|
||||
mock.$defineRoutes({
|
||||
"POST /item": function(request) {
|
||||
return {status: 200, responseText: ""}
|
||||
|
|
@ -264,4 +264,4 @@ o.spec("xhr", function() {
|
|||
}).map(done)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue