Commit 93888b58 authored by Jonathan Rivalan's avatar Jonathan Rivalan

Validation for get test

parent 713a80e2
......@@ -312,11 +312,14 @@
break;
case 'GET':
if (jio === true) {
if (typeof this.responseText !== 'string') {
console.log(http);
console.log(obj);
console.log(typeof this.responseText);
if (typeof this.responseText === 'string') {
response = JSON.parse(this.responseText);
response._attachments = response._attachments || {};
delete response._attachments;
//command.success(JSON.stringify(response));
//response._attachments = response._attachments || {};
//delete response._attachments;
command.success(this.status,{'data':response});
} else {
if (isAttachment === true) {
//command.success(this.responseText);
......@@ -618,10 +621,11 @@
**/
that.put = function (command, metadata, options) {
var doc, docId, mime;
var doc, docId, mime, created;
doc = metadata;
docId = doc._id;
mime = 'text/plain; charset=UTF-8';
created = false;
//pas d'attachment dans un put simple
function putDocument() {
var attachId, data, isJIO;
......@@ -645,6 +649,7 @@
doc._attachments = response._attachments;
}
putDocument();
//TODO : control non existing document to throw a 201 http code
}
);
};
......
......@@ -936,7 +936,7 @@
// put 201
putNewDocument().then(putNewDocumentTest).
// get 200
//then(getCreatedDocument2).then(getCreatedDocument2Test).
then(getCreatedDocument2).then(getCreatedDocument2Test).
// post 409
//then(postSameDocument).then(postSameDocumentTest).
// putA a 204
......
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