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
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
326eba96
Commit
326eba96
authored
Jan 16, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webDav Storage PUT: updated code and qunit tests
parent
a259f6b4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
src/jio.storage/davstorage.js
src/jio.storage/davstorage.js
+0
-1
test/jiotests.js
test/jiotests.js
+53
-1
No files found.
src/jio.storage/davstorage.js
View file @
326eba96
...
...
@@ -162,7 +162,6 @@ jIO.addStorageType('dav', function (spec, my) {
return
;
}
else
{
// PUT update document
// remove first or can webDav overwrite?
$
.
ajax
({
url
:
url
+
'
?_=
'
+
Date
.
now
(),
type
:
type
,
...
...
test/jiotests.js
View file @
326eba96
...
...
@@ -2039,7 +2039,7 @@ test ("Post", function () {
// post non empty document
o
.
addFakeServerResponse
(
"
PUT
"
,
"
myFile
"
,
201
,
"
HTML RESPONSE
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
id
"
:
"
myFile
"
,
"
ok
"
:
true
},
"
Post
non empty document
"
);
"
Create = POST
non empty document
"
);
o
.
jio
.
post
({
"
_id
"
:
"
myFile
"
,
"
title
"
:
"
hello there
"
},
o
.
f
);
o
.
clock
.
tick
(
5000
);
o
.
server
.
respond
();
...
...
@@ -2056,6 +2056,58 @@ test ("Post", function () {
o
.
jio
.
stop
();
// do the same tests live webDav-Server
// check for credentials in sinon
/* also check for equality
deepEqual(
localstorage.getItem("jio/localstorage/uput/aput/put1"),
{
"_id": "put1",
"title": "myPut1"
},
"Check document"
);
*/
});
test
(
"
Put
"
,
function
(){
var
o
=
generateTools
(
this
);
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
dav
"
,
"
username
"
:
"
davput
"
,
"
password
"
:
"
checkpwd
"
,
"
url
"
:
"
https://ca-davstorage:8080
"
});
// put without id => id required
o
.
spy
(
o
,
"
status
"
,
20
,
"
Put without id
"
);
o
.
jio
.
put
({},
o
.
f
);
o
.
clock
.
tick
(
5000
);
// put non empty document
o
.
addFakeServerResponse
(
"
PUT
"
,
"
put1
"
,
201
,
"
HTML RESPONSE
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
put1
"
},
"
Create = PUT non empty document
"
);
o
.
jio
.
put
({
"
_id
"
:
"
put1
"
,
"
title
"
:
"
myPut1
"
},
o
.
f
);
o
.
clock
.
tick
(
5000
);
o
.
server
.
respond
();
// put but document already exists = update
o
.
answer
=
JSON
.
stringify
({
"
_id
"
:
"
put1
"
,
"
title
"
:
"
myPut1
"
});
o
.
addFakeServerResponse
(
"
GET
"
,
"
put1
"
,
200
,
o
.
answer
);
o
.
addFakeServerResponse
(
"
PUT
"
,
"
put1
"
,
201
,
"
HTML RESPONSE
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
put1
"
},
"
Updated the document
"
);
o
.
jio
.
put
({
"
_id
"
:
"
put1
"
,
"
title
"
:
"
myPut2abcdedg
"
},
o
.
f
);
o
.
clock
.
tick
(
5000
);
o
.
server
.
respond
();
o
.
jio
.
stop
();
// do the same tests live webDav-Server
// check for credentials in sinon
});
/*
// note: http errno:
...
...
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