Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
jio-main
Commits
93888b58
Commit
93888b58
authored
Oct 17, 2013
by
Jonathan Rivalan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validation for get test
parent
713a80e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/jio.storage/s3storage.js
src/jio.storage/s3storage.js
+10
-5
test/jio.storage/s3storage.tests.js
test/jio.storage/s3storage.tests.js
+1
-1
No files found.
src/jio.storage/s3storage.js
View file @
93888b58
...
@@ -312,11 +312,14 @@
...
@@ -312,11 +312,14 @@
break
;
break
;
case
'
GET
'
:
case
'
GET
'
:
if
(
jio
===
true
)
{
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
=
JSON
.
parse
(
this
.
responseText
);
response
.
_attachments
=
response
.
_attachments
||
{};
//
response._attachments = response._attachments || {};
delete
response
.
_attachments
;
//
delete response._attachments;
//command.success(JSON.stringify(response)
);
command
.
success
(
this
.
status
,{
'
data
'
:
response
}
);
}
else
{
}
else
{
if
(
isAttachment
===
true
)
{
if
(
isAttachment
===
true
)
{
//command.success(this.responseText);
//command.success(this.responseText);
...
@@ -618,10 +621,11 @@
...
@@ -618,10 +621,11 @@
**/
**/
that
.
put
=
function
(
command
,
metadata
,
options
)
{
that
.
put
=
function
(
command
,
metadata
,
options
)
{
var
doc
,
docId
,
mime
;
var
doc
,
docId
,
mime
,
created
;
doc
=
metadata
;
doc
=
metadata
;
docId
=
doc
.
_id
;
docId
=
doc
.
_id
;
mime
=
'
text/plain; charset=UTF-8
'
;
mime
=
'
text/plain; charset=UTF-8
'
;
created
=
false
;
//pas d'attachment dans un put simple
//pas d'attachment dans un put simple
function
putDocument
()
{
function
putDocument
()
{
var
attachId
,
data
,
isJIO
;
var
attachId
,
data
,
isJIO
;
...
@@ -645,6 +649,7 @@
...
@@ -645,6 +649,7 @@
doc
.
_attachments
=
response
.
_attachments
;
doc
.
_attachments
=
response
.
_attachments
;
}
}
putDocument
();
putDocument
();
//TODO : control non existing document to throw a 201 http code
}
}
);
);
};
};
...
...
test/jio.storage/s3storage.tests.js
View file @
93888b58
...
@@ -936,7 +936,7 @@
...
@@ -936,7 +936,7 @@
// put 201
// put 201
putNewDocument
().
then
(
putNewDocumentTest
).
putNewDocument
().
then
(
putNewDocumentTest
).
// get 200
// get 200
//
then(getCreatedDocument2).then(getCreatedDocument2Test).
then
(
getCreatedDocument2
).
then
(
getCreatedDocument2Test
).
// post 409
// post 409
//then(postSameDocument).then(postSameDocumentTest).
//then(postSameDocument).then(postSameDocumentTest).
// putA a 204
// putA a 204
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment