Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
jio
Commits
b1df058c
Commit
b1df058c
authored
Apr 11, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replicatestorage put test added
parent
e3989e3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletion
+45
-1
test/jio.storage/replicatestorage.tests.js
test/jio.storage/replicatestorage.tests.js
+45
-1
No files found.
test/jio.storage/replicatestorage.tests.js
View file @
b1df058c
...
...
@@ -394,7 +394,7 @@
then
(
start
,
start
);
});
test
(
"
Post
"
,
function
()
{
test
(
"
Post
+ Put
"
,
function
()
{
var
shared
=
{},
i
,
jio_list
,
replicate_jio
;
// this test can work with at least 2 sub storages
...
...
@@ -502,6 +502,46 @@
});
}
function
updateDocument
()
{
return
replicate_jio
.
put
({
"
_id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
,
"
identifier
"
:
"
a
"
,
"
title
"
:
"
b
"
});
}
function
updateDocumentTest
(
answer
)
{
deepEqual
(
answer
,
{
"
id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
,
"
method
"
:
"
put
"
,
"
result
"
:
"
success
"
,
"
status
"
:
204
,
"
statusText
"
:
"
No Content
"
},
"
Update document
"
);
}
function
checkStorageContent3
()
{
// check storage state
return
all
(
jio_list
.
map
(
function
(
jio
)
{
return
jio
.
get
({
"
_id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
});
})).
then
(
function
(
answers
)
{
answers
.
forEach
(
function
(
answer
)
{
deepEqual
(
answer
,
{
"
data
"
:
{
"
_id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
,
"
identifier
"
:
"
a
"
,
"
title
"
:
"
b
"
},
"
id
"
:
"
{
\"
identifier
\"
:[
\"
a
\"
]}
"
,
"
method
"
:
"
get
"
,
"
result
"
:
"
success
"
,
"
status
"
:
200
,
"
statusText
"
:
"
Ok
"
},
"
Check storage content
"
);
});
});
}
function
createDocumentWithUnavailableStorage
()
{
setFakeStorage
();
setTimeout
(
function
()
{
...
...
@@ -575,6 +615,10 @@
then
(
createDocument
).
then
(
createDocumentTest
).
then
(
checkStorageContent
).
// update document
then
(
updateDocument
).
then
(
updateDocumentTest
).
then
(
checkStorageContent3
).
// create a document with unavailable storage
then
(
createDocumentWithUnavailableStorage
).
then
(
createDocumentWithUnavailableStorageTest
).
...
...
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