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
Alain Takoudjou
jio
Commits
7f6d4a31
Commit
7f6d4a31
authored
Sep 20, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davstorage.tests.js fake server tests completed
parent
ca9feaea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
0 deletions
+126
-0
test/jio.storage/davstorage.tests.js
test/jio.storage/davstorage.tests.js
+126
-0
No files found.
test/jio.storage/davstorage.tests.js
View file @
7f6d4a31
...
@@ -601,6 +601,29 @@
...
@@ -601,6 +601,29 @@
}
}
function
getSecondAttachment
()
{
function
getSecondAttachment
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
},
"
ab
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-e124adcce1fb2f88e1ea799c3d0820845
"
+
"
ed343e6c739e54131fcb3a56e4bc1bd
"
,
"
length
"
:
3
}
}
})]);
// GET
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
"
aba
"
]);
// GET
return
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
});
return
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
});
}
}
...
@@ -627,6 +650,26 @@
...
@@ -627,6 +650,26 @@
}
}
function
getLastDocument
()
{
function
getLastDocument
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
},
"
ab
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-e124adcce1fb2f88e1ea799c3d0820845
"
+
"
ed343e6c739e54131fcb3a56e4bc1bd
"
,
"
length
"
:
3
}
}
})]);
// GET
return
jio
.
get
({
"
_id
"
:
"
a
"
});
return
jio
.
get
({
"
_id
"
:
"
a
"
});
}
}
...
@@ -659,6 +702,28 @@
...
@@ -659,6 +702,28 @@
}
}
function
removeSecondAttachment
()
{
function
removeSecondAttachment
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
},
"
ab
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-e124adcce1fb2f88e1ea799c3d0820845
"
+
"
ed343e6c739e54131fcb3a56e4bc1bd
"
,
"
length
"
:
3
}
}
})]);
// GET
responses
.
push
([
204
,
{},
''
]);
// PUT
responses
.
push
([
204
,
{},
''
]);
// DELETE
return
jio
.
removeAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
});
return
jio
.
removeAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
});
}
}
...
@@ -674,6 +739,20 @@
...
@@ -674,6 +739,20 @@
}
}
function
getInexistentSecondAttachment
()
{
function
getInexistentSecondAttachment
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
}
}
})]);
// GET
return
success
(
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
}));
return
success
(
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
}));
}
}
...
@@ -692,6 +771,20 @@
...
@@ -692,6 +771,20 @@
}
}
function
getOneAttachmentDocument
()
{
function
getOneAttachmentDocument
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
}
}
})]);
// GET
return
jio
.
get
({
"
_id
"
:
"
a
"
});
return
jio
.
get
({
"
_id
"
:
"
a
"
});
}
}
...
@@ -718,6 +811,20 @@
...
@@ -718,6 +811,20 @@
}
}
function
removeSecondAttachmentAgain
()
{
function
removeSecondAttachmentAgain
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
}
}
})]);
// GET
return
success
(
jio
.
removeAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
}));
return
success
(
jio
.
removeAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
ab
"
}));
}
}
...
@@ -736,6 +843,22 @@
...
@@ -736,6 +843,22 @@
}
}
function
removeDocument
()
{
function
removeDocument
()
{
responses
.
push
([
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
},
JSON
.
stringify
({
"
_id
"
:
"
a
"
,
"
title
"
:
"
Hoo
"
,
"
_attachments
"
:
{
"
aa
"
:
{
"
content_type
"
:
"
text/plain
"
,
"
digest
"
:
"
sha256-38760eabb666e8e61ee628a17c4090cc5
"
+
"
0728e095ff24218119d51bd22475363
"
,
"
length
"
:
3
}
}
})]);
// GET
responses
.
push
([
204
,
{},
''
]);
// DELETE (metadata)
responses
.
push
([
204
,
{},
''
]);
// DELETE (attachment aa)
return
jio
.
remove
({
"
_id
"
:
"
a
"
});
return
jio
.
remove
({
"
_id
"
:
"
a
"
});
}
}
...
@@ -750,6 +873,7 @@
...
@@ -750,6 +873,7 @@
}
}
function
getInexistentFirstAttachment
()
{
function
getInexistentFirstAttachment
()
{
responses
.
push
([
404
,
{},
''
]);
// GET
return
success
(
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
aa
"
}));
return
success
(
jio
.
getAttachment
({
"
_id
"
:
"
a
"
,
"
_attachment
"
:
"
aa
"
}));
}
}
...
@@ -768,6 +892,7 @@
...
@@ -768,6 +892,7 @@
}
}
function
getInexistentDocument
()
{
function
getInexistentDocument
()
{
responses
.
push
([
404
,
{},
''
]);
// GET
return
success
(
jio
.
get
({
"
_id
"
:
"
a
"
}));
return
success
(
jio
.
get
({
"
_id
"
:
"
a
"
}));
}
}
...
@@ -785,6 +910,7 @@
...
@@ -785,6 +910,7 @@
}
}
function
removeInexistentDocument
()
{
function
removeInexistentDocument
()
{
responses
.
push
([
404
,
{},
''
]);
// GET
return
success
(
jio
.
remove
({
"
_id
"
:
"
a
"
}));
return
success
(
jio
.
remove
({
"
_id
"
:
"
a
"
}));
}
}
...
...
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