Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Bryan Kaperick
jio
Commits
87f4360e
Commit
87f4360e
authored
Jun 25, 2018
by
Bryan Kaperick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added additional allDocs test.
parent
6f1464b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
27 deletions
+44
-27
test/jio.storage/historystorage.tests.js
test/jio.storage/historystorage.tests.js
+44
-27
No files found.
test/jio.storage/historystorage.tests.js
View file @
87f4360e
...
@@ -702,22 +702,22 @@
...
@@ -702,22 +702,22 @@
test
(
"
Putting a document, revising it, and retrieving revisions with allDocs
"
,
test
(
"
Putting a document, revising it, and retrieving revisions with allDocs
"
,
function
()
{
function
()
{
stop
();
stop
();
expect
(
13
);
expect
(
14
);
var
context
=
this
,
var
jio
=
this
.
jio
,
timestamps
;
not_history
=
this
.
not_history
,
context
.
jio
.
put
(
"
doc
"
,
{
timestamps
=
this
.
jio
.
__storage
.
_timestamps
;
jio
.
put
(
"
doc
"
,
{
title
:
"
version0
"
,
title
:
"
version0
"
,
subtitle
:
"
subvers0
"
subtitle
:
"
subvers0
"
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
context
.
jio
.
put
(
"
doc
"
,
{
return
jio
.
put
(
"
doc
"
,
{
title
:
"
version1
"
,
title
:
"
version1
"
,
subtitle
:
"
subvers1
"
subtitle
:
"
subvers1
"
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
timestamps
=
context
.
jio
.
__storage
.
_timestamps
.
doc
;
return
jio
.
put
(
"
doc
"
,
{
return
context
.
jio
.
put
(
"
doc
"
,
{
title
:
"
version2
"
,
title
:
"
version2
"
,
subtitle
:
"
subvers2
"
subtitle
:
"
subvers2
"
});
});
...
@@ -725,24 +725,24 @@
...
@@ -725,24 +725,24 @@
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
context
.
jio
.
allDocs
({
select_list
:
[
"
title
"
,
"
subtitle
"
]}),
jio
.
allDocs
({
select_list
:
[
"
title
"
,
"
subtitle
"
]}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
""
,
query
:
""
,
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
title: version2
"
,
query
:
"
title: version2
"
,
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
NOT (title: version1)
"
,
query
:
"
NOT (title: version1)
"
,
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
(NOT (subtitle: subvers1)) AND (NOT (title: version0))
"
,
query
:
"
(NOT (subtitle: subvers1)) AND (NOT (title: version0))
"
,
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
limit
:
[
0
,
1
],
limit
:
[
0
,
1
],
sort_on
:
[[
"
title
"
,
"
ascending
"
]],
sort_on
:
[[
"
title
"
,
"
ascending
"
]],
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
...
@@ -776,21 +776,22 @@
...
@@ -776,21 +776,22 @@
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
_timestamp:
"
+
timestamps
[
1
],
query
:
"
_timestamp:
"
+
timestamps
.
doc
[
1
],
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
_timestamp: =
"
+
timestamps
[
1
],
query
:
"
_timestamp: =
"
+
timestamps
.
doc
[
1
],
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
_timestamp: >
"
+
timestamps
[
0
]
+
"
AND title: version1
"
,
query
:
"
_timestamp: >
"
+
timestamps
.
doc
[
0
]
+
"
AND title: version1
"
,
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
}),
}),
context
.
jio
.
allDocs
({
jio
.
allDocs
({
query
:
"
_timestamp: >
"
+
timestamps
[
0
]
+
"
AND _timestamp: <
"
+
query
:
"
_timestamp: >
"
+
timestamps
.
doc
[
0
]
+
timestamps
[
2
],
"
AND _timestamp: <
"
+
timestamps
.
doc
[
2
],
select_list
:
[
"
title
"
,
"
subtitle
"
]
select_list
:
[
"
title
"
,
"
subtitle
"
]
})
})
]);
]);
...
@@ -817,20 +818,36 @@
...
@@ -817,20 +818,36 @@
},
},
doc
:
{}
doc
:
{}
});
});
return
jio
.
allDocs
({
query
:
"
_timestamp:
"
+
timestamps
.
doc
[
0
],
select_list
:
[
"
title
"
,
"
subtitle
"
]
});
})
.
push
(
function
(
results
)
{
deepEqual
(
results
.
data
.
rows
,
[
{
value
:
{
title
:
"
version0
"
,
subtitle
:
"
subvers0
"
},
doc
:
{},
id
:
"
doc
"
}
],
"
Query requesting one timestamp works.
"
);
return
context
.
not_history
.
allDocs
({
return
not_history
.
allDocs
({
sort_on
:
[[
"
title
"
,
"
ascending
"
]]
sort_on
:
[[
"
title
"
,
"
ascending
"
]]
});
});
})
})
.
push
(
function
(
results
)
{
.
push
(
function
(
results
)
{
return
RSVP
.
all
(
results
.
data
.
rows
.
map
(
function
(
d
)
{
return
RSVP
.
all
(
results
.
data
.
rows
.
map
(
function
(
d
)
{
return
context
.
not_history
.
get
(
d
.
id
);
return
not_history
.
get
(
d
.
id
);
}));
}));
})
})
.
push
(
function
(
results
)
{
.
push
(
function
(
results
)
{
deepEqual
(
results
,
[
deepEqual
(
results
,
[
{
{
timestamp
:
timestamps
[
0
],
timestamp
:
timestamps
.
doc
[
0
],
op
:
"
put
"
,
op
:
"
put
"
,
doc_id
:
"
doc
"
,
doc_id
:
"
doc
"
,
doc
:
{
doc
:
{
...
@@ -839,7 +856,7 @@
...
@@ -839,7 +856,7 @@
}
}
},
},
{
{
timestamp
:
timestamps
[
1
],
timestamp
:
timestamps
.
doc
[
1
],
op
:
"
put
"
,
op
:
"
put
"
,
doc_id
:
"
doc
"
,
doc_id
:
"
doc
"
,
doc
:
{
doc
:
{
...
@@ -848,7 +865,7 @@
...
@@ -848,7 +865,7 @@
}
}
},
},
{
{
timestamp
:
timestamps
[
2
],
timestamp
:
timestamps
.
doc
[
2
],
op
:
"
put
"
,
op
:
"
put
"
,
doc_id
:
"
doc
"
,
doc_id
:
"
doc
"
,
doc
:
{
doc
:
{
...
...
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