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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaohe Cao
jio
Commits
13a338f9
Commit
13a338f9
authored
Dec 28, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post method jiotest revision + local
parent
0b8d4e96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
test/jiotests.js
test/jiotests.js
+75
-0
No files found.
test/jiotests.js
View file @
13a338f9
...
...
@@ -1025,6 +1025,81 @@ test ("AllDocs", function(){
});
module
(
"
Jio Revision Storage + Local Storage
"
);
test
(
"
Post
"
,
function
(){
var
o
=
generateTools
(
this
);
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
revision
"
,
"
secondstorage
"
:
{
"
type
"
:
"
local
"
,
"
username
"
:
"
urevpost
"
,
"
applicationname
"
:
"
arevpost
"
}
});
// post without id
o
.
spy
(
o
,
"
status
"
,
undefined
,
"
Post without id
"
);
o
.
jio
.
post
({},
function
(
err
,
response
)
{
o
.
f
.
apply
(
arguments
);
if
(
isUuid
((
err
||
response
).
id
))
{
ok
(
true
,
"
Uuid format
"
);
}
else
{
deepEqual
((
err
||
response
).
id
,
"
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
"
,
"
Uuid format
"
);
}
});
o
.
tick
(
o
);
// post non empty document
o
.
doc
=
{
"
_id
"
:
"
post1
"
,
"
title
"
:
"
myPost1
"
};
o
.
revs_info
=
[];
o
.
rev
=
"
1-
"
+
hex_sha256
(
JSON
.
stringify
(
o
.
doc
)
+
JSON
.
stringify
(
o
.
revs_info
));
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
post1
"
,
"
rev
"
:
o
.
rev
},
"
Post
"
);
o
.
jio
.
post
(
o
.
doc
,
o
.
f
);
o
.
tick
(
o
);
// check document
o
.
doc
[
"
_id
"
]
=
"
post1.
"
+
o
.
rev
;
deepEqual
(
localstorage
.
getItem
(
"
jio/localstorage/urevpost/arevpost/post1.
"
+
o
.
rev
),
o
.
doc
,
"
Check document
"
);
// post and document already exists
o
.
doc
=
{
"
_id
"
:
"
post1
"
,
"
title
"
:
"
myPost2
"
};
o
.
revs_info
=
[];
o
.
rev
=
"
1-
"
+
hex_sha256
(
JSON
.
stringify
(
o
.
doc
)
+
JSON
.
stringify
(
o
.
revs_info
));
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
post1
"
,
"
rev
"
:
o
.
rev
},
"
Post and document already exists
"
);
o
.
jio
.
post
(
o
.
doc
,
o
.
f
);
o
.
tick
(
o
);
// post + revision
o
.
doc
=
{
"
_id
"
:
"
post1
"
,
"
_rev
"
:
o
.
rev
,
"
title
"
:
"
myPost2
"
};
o
.
revs_info
=
[{
"
rev
"
:
o
.
rev
,
"
status
"
:
"
available
"
}];
o
.
rev
=
"
2-
"
+
hex_sha256
(
JSON
.
stringify
(
o
.
doc
)
+
JSON
.
stringify
(
o
.
revs_info
));
o
.
spy
(
o
,
"
status
"
,
undefined
,
"
Post + revision
"
);
o
.
jio
.
post
(
o
.
doc
,
o
.
f
);
o
.
tick
(
o
);
// // keep_revision_history
// ok (false, "keep_revision_history Option Not Implemented");
// check document
o
.
doc
[
"
_id
"
]
=
"
post1.
"
+
o
.
rev
;
deepEqual
(
localstorage
.
getItem
(
"
jio/localstorage/urevpost/arevpost/post1.
"
+
o
.
rev
),
o
.
doc
,
"
Check document
"
);
o
.
jio
.
stop
();
});
/*
module ('Jio DAVStorage');
...
...
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