From 871603e505f23789dbad26a3242db41e1fb31a83 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Thu, 22 Oct 2009 19:58:18 +0000 Subject: Improve OAuth error message for missing tokens. Added a test in oauth.js git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@828836 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/oauth.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'share') diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js index b14ccbc5..5c6c0083 100644 --- a/share/www/script/test/oauth.js +++ b/share/www/script/test/oauth.js @@ -196,6 +196,12 @@ couchTests.oauth = function(debug) { T(data.name == "testadmin"); T(data.roles[0] == "_admin"); } + + // Test when the user's token doesn't exist. + message.parameters.oauth_token = "not a token!"; + xhr = oauthRequest("GET", "http://" + host + "/_session?foo=bar", + message, adminAccessor); + T(xhr.status == 400, "Request should be invalid."); } } } finally { -- cgit v1.2.3