Commit af5c85a2 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Romain Courteaud

erp5storage: putAttachment returns xhr.responseType blob

/reviewed-on !50
parent d0a43f62
...@@ -437,6 +437,7 @@ ...@@ -437,6 +437,7 @@
"type": "POST", "type": "POST",
"url": name, "url": name,
"data": data, "data": data,
"dataType": "blob",
"xhrFields": { "xhrFields": {
withCredentials: true withCredentials: true
} }
......
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
}, ""]); }, ""]);
stop(); stop();
expect(11); expect(12);
this.jio.putAttachment( this.jio.putAttachment(
id, id,
...@@ -502,6 +502,7 @@ ...@@ -502,6 +502,7 @@
equal(server.requests[0].method, "POST"); equal(server.requests[0].method, "POST");
equal(server.requests[0].url, submit_url); equal(server.requests[0].url, submit_url);
equal(server.requests[0].status, 204); equal(server.requests[0].status, 204);
equal(server.requests[0].responseType, "blob");
ok(server.requests[0].requestBody instanceof FormData); ok(server.requests[0].requestBody instanceof FormData);
ok(context.spy.calledTwice, "FormData.append count " + ok(context.spy.calledTwice, "FormData.append count " +
...@@ -536,7 +537,7 @@ ...@@ -536,7 +537,7 @@
}, ""]); }, ""]);
stop(); stop();
expect(11); expect(12);
this.jio.putAttachment( this.jio.putAttachment(
id, id,
...@@ -548,6 +549,7 @@ ...@@ -548,6 +549,7 @@
equal(server.requests[0].method, "POST"); equal(server.requests[0].method, "POST");
equal(server.requests[0].url, submit_url); equal(server.requests[0].url, submit_url);
equal(server.requests[0].status, 204); equal(server.requests[0].status, 204);
equal(server.requests[0].responseType, "blob");
ok(server.requests[0].requestBody instanceof FormData); ok(server.requests[0].requestBody instanceof FormData);
ok(context.spy.calledTwice, "FormData.append count " + ok(context.spy.calledTwice, "FormData.append count " +
...@@ -586,7 +588,7 @@ ...@@ -586,7 +588,7 @@
}, ""]); }, ""]);
stop(); stop();
expect(12); expect(13);
this.jio.putAttachment( this.jio.putAttachment(
id, id,
...@@ -598,6 +600,7 @@ ...@@ -598,6 +600,7 @@
equal(server.requests[0].method, "POST"); equal(server.requests[0].method, "POST");
equal(server.requests[0].url, submit_url); equal(server.requests[0].url, submit_url);
equal(server.requests[0].status, 204); equal(server.requests[0].status, 204);
equal(server.requests[0].responseType, "blob");
ok(server.requests[0].requestBody instanceof FormData); ok(server.requests[0].requestBody instanceof FormData);
ok(context.spy.calledOnce, "FormData.append count " + ok(context.spy.calledOnce, "FormData.append count " +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment