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
a497d65a
Commit
a497d65a
authored
Jan 08, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some important tests to revision + local Put method
parent
d63e557a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
7 deletions
+38
-7
test/jiotests.js
test/jiotests.js
+38
-7
No files found.
test/jiotests.js
View file @
a497d65a
...
@@ -1232,6 +1232,7 @@ test ("Put", function(){
...
@@ -1232,6 +1232,7 @@ test ("Put", function(){
"
application_name
"
:
"
arevput
"
"
application_name
"
:
"
arevput
"
}
}
});
});
o
.
localpath
=
"
jio/localstorage/urevput/arevput
"
;
// put without id
// put without id
// error 20 -> document id required
// error 20 -> document id required
...
@@ -1249,10 +1250,26 @@ test ("Put", function(){
...
@@ -1249,10 +1250,26 @@ test ("Put", function(){
o
.
tick
(
o
);
o
.
tick
(
o
);
// check document
// check document
o
.
doc
[
"
_id
"
]
=
"
put1.
"
+
o
.
rev
;
o
.
doc
.
_id
=
"
put1.
"
+
o
.
rev
;
deepEqual
(
deepEqual
(
localstorage
.
getItem
(
"
jio/localstorage/urevput/arevput/put1.
"
+
o
.
rev
),
localstorage
.
getItem
(
o
.
localpath
+
"
/put1.
"
+
o
.
rev
),
o
.
doc
,
"
Check document
"
o
.
doc
,
"
Check document
"
);
// check document tree
o
.
doc_tree
=
{
"
_id
"
:
"
put1.revision_tree.json
"
,
"
children
"
:
[{
"
rev
"
:
o
.
rev
,
"
status
"
:
"
available
"
,
"
children
"
:
[]
}]
};
deepEqual
(
localstorage
.
getItem
(
o
.
localpath
+
"
/put1.revision_tree.json
"
),
o
.
doc_tree
,
"
Check document tree
"
);
);
// put and document already exists
// put and document already exists
...
@@ -1260,7 +1277,8 @@ test ("Put", function(){
...
@@ -1260,7 +1277,8 @@ test ("Put", function(){
o
.
jio
.
put
({
"
_id
"
:
"
put1
"
,
"
title
"
:
"
myPut2
"
},
o
.
f
);
o
.
jio
.
put
({
"
_id
"
:
"
put1
"
,
"
title
"
:
"
myPut2
"
},
o
.
f
);
o
.
tick
(
o
);
o
.
tick
(
o
);
// post + revision
// put + revision
o
.
doc
=
{
"
_id
"
:
"
put1
"
,
"
_rev
"
:
o
.
rev
,
"
title
"
:
"
myPut2
"
};
o
.
doc
=
{
"
_id
"
:
"
put1
"
,
"
_rev
"
:
o
.
rev
,
"
title
"
:
"
myPut2
"
};
o
.
revisions
=
{
"
start
"
:
1
,
"
ids
"
:
[
o
.
rev
.
split
(
'
-
'
)[
1
]]};
o
.
revisions
=
{
"
start
"
:
1
,
"
ids
"
:
[
o
.
rev
.
split
(
'
-
'
)[
1
]]};
o
.
rev
=
"
2-
"
+
generateRevisionHash
(
o
.
doc
,
o
.
revisions
);
o
.
rev
=
"
2-
"
+
generateRevisionHash
(
o
.
doc
,
o
.
revisions
);
...
@@ -1269,10 +1287,23 @@ test ("Put", function(){
...
@@ -1269,10 +1287,23 @@ test ("Put", function(){
o
.
tick
(
o
);
o
.
tick
(
o
);
// check document
// check document
o
.
doc
[
"
_id
"
]
=
"
put1.
"
+
o
.
rev
;
o
.
doc
.
_id
=
"
put1.
"
+
o
.
rev
;
deepEqual
(
deepEqual
(
localstorage
.
getItem
(
"
jio/localstorage/urevput/arevput/put1.
"
+
o
.
rev
),
localstorage
.
getItem
(
o
.
localpath
+
"
/put1.
"
+
o
.
rev
),
o
.
doc
,
"
Check document
"
o
.
doc
,
"
Check document
"
);
// check document tree
o
.
doc_tree
.
children
[
0
].
children
.
unshift
({
"
rev
"
:
o
.
rev
,
"
status
"
:
"
available
"
,
"
children
"
:
[]
});
deepEqual
(
localstorage
.
getItem
(
o
.
localpath
+
"
/put1.revision_tree.json
"
),
o
.
doc_tree
,
"
Check document tree
"
);
);
o
.
jio
.
stop
();
o
.
jio
.
stop
();
...
...
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