summaryrefslogtreecommitdiff
path: root/share/www/script/test/cookie_auth.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/test/cookie_auth.js')
-rw-r--r--share/www/script/test/cookie_auth.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/share/www/script/test/cookie_auth.js b/share/www/script/test/cookie_auth.js
index 68ec882d..e919ed02 100644
--- a/share/www/script/test/cookie_auth.js
+++ b/share/www/script/test/cookie_auth.js
@@ -104,6 +104,18 @@ couchTests.cookie_auth = function(debug) {
T(CouchDB.login('Jason Davies', password).ok);
T(CouchDB.session().userCtx.name == 'Jason Davies');
+ // JSON login works
+ xhr = CouchDB.request("POST", "/_session", {
+ headers: {"Content-Type": "application/json"},
+ body: JSON.stringify({
+ name: 'Jason Davies',
+ password: password
+ })
+ });
+
+ T(JSON.parse(xhr.responseText).ok);
+ T(CouchDB.session().userCtx.name == 'Jason Davies');
+
// update one's own credentials document
jasonUserDoc.foo=2;
T(usersDb.save(jasonUserDoc).ok);