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
Kirill Smelkov
jio
Commits
dc8e8bf1
Commit
dc8e8bf1
authored
Feb 06, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davstorage putAttachment to no document test added
parent
40a88b02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
test/jio.storage/davstorage.tests.js
test/jio.storage/davstorage.tests.js
+28
-1
No files found.
test/jio.storage/davstorage.tests.js
View file @
dc8e8bf1
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
* X-Requested-With, X-HTTP-Method-Override, Accept, Authorization,
* X-Requested-With, X-HTTP-Method-Override, Accept, Authorization,
* Depth"
* Depth"
*/
*/
test
(
"
Scenario
"
,
3
3
,
function
()
{
test
(
"
Scenario
"
,
3
4
,
function
()
{
var
server
,
responses
=
[],
shared
=
{},
jio
=
jIO
.
createJIO
(
spec
,
{
var
server
,
responses
=
[],
shared
=
{},
jio
=
jIO
.
createJIO
(
spec
,
{
"
workspace
"
:
{},
"
workspace
"
:
{},
...
@@ -755,6 +755,30 @@
...
@@ -755,6 +755,30 @@
},
"
Unable to post the same document (conflict)
"
);
},
"
Unable to post the same document (conflict)
"
);
}
}
function
putAttachmentToNonExistentDocument
()
{
responses
.
push
([
404
,
{},
""
]);
// GET
return
success
(
jio
.
putAttachment
({
"
_id
"
:
"
ahaha
"
,
"
_attachment
"
:
"
aa
"
,
"
_data
"
:
"
aaa
"
,
"
_content_type
"
:
"
text/plain
"
}));
}
function
putAttachmentToNonExistentDocumentTest
(
answer
)
{
deepEqual
(
answer
,
{
"
attachment
"
:
"
aa
"
,
"
error
"
:
"
not_found
"
,
"
id
"
:
"
ahaha
"
,
"
message
"
:
"
DavStorage unable to put attachment
"
,
"
method
"
:
"
putAttachment
"
,
"
reason
"
:
"
Not Found
"
,
"
result
"
:
"
error
"
,
"
status
"
:
404
,
"
statusText
"
:
"
Not Found
"
},
"
Put attachment to a non existent document -> 404 Not Found
"
);
}
function
createAttachment
()
{
function
createAttachment
()
{
responses
.
push
([
200
,
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
"
Content-Type
"
:
"
application/octet-stream
"
...
@@ -1311,6 +1335,9 @@
...
@@ -1311,6 +1335,9 @@
then
(
getCreatedDocument2
).
then
(
getCreatedDocument2Test
).
then
(
getCreatedDocument2
).
then
(
getCreatedDocument2Test
).
// post 409
// post 409
then
(
postSameDocument
).
then
(
postSameDocumentTest
).
then
(
postSameDocument
).
then
(
postSameDocumentTest
).
// putA 404
then
(
putAttachmentToNonExistentDocument
).
then
(
putAttachmentToNonExistentDocumentTest
).
// putA a 204
// putA a 204
then
(
createAttachment
).
then
(
createAttachmentTest
).
then
(
createAttachment
).
then
(
createAttachmentTest
).
// 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