couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1036447 - in /couchdb/trunk/share/www/script/test: basics.js cookie_auth.js proxyauth.js view_multi_key_design.js view_update_seq.js
Date Thu, 18 Nov 2010 13:20:15 GMT
Author: fdmanana
Date: Thu Nov 18 13:20:14 2010
New Revision: 1036447

URL: http://svn.apache.org/viewvc?rev=1036447&view=rev
Log:
JavaScript tests: avoid global variable declarations.

Modified:
    couchdb/trunk/share/www/script/test/basics.js
    couchdb/trunk/share/www/script/test/cookie_auth.js
    couchdb/trunk/share/www/script/test/proxyauth.js
    couchdb/trunk/share/www/script/test/view_multi_key_design.js
    couchdb/trunk/share/www/script/test/view_update_seq.js

Modified: couchdb/trunk/share/www/script/test/basics.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/basics.js?rev=1036447&r1=1036446&r2=1036447&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/basics.js (original)
+++ couchdb/trunk/share/www/script/test/basics.js Thu Nov 18 13:20:14 2010
@@ -90,13 +90,13 @@ couchTests.basics = function(debug) {
       emit(null, doc.b);
   };
 
-  results = db.query(mapFunction);
+  var results = db.query(mapFunction);
 
   // verify only one document found and the result value (doc.b).
   T(results.total_rows == 1 && results.rows[0].value == 16);
 
   // reopen document we saved earlier
-  existingDoc = db.open(id);
+  var existingDoc = db.open(id);
 
   T(existingDoc.a==1);
 
@@ -189,7 +189,7 @@ couchTests.basics = function(debug) {
   T(xhr.status == 404);
 
   // Check for invalid document members
-  bad_docs = [
+  var bad_docs = [
     ["goldfish", {"_zing": 4}],
     ["zebrafish", {"_zoom": "hello"}],
     ["mudfish", {"zane": "goldfish", "_fan": "something smells delicious"}],

Modified: couchdb/trunk/share/www/script/test/cookie_auth.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/cookie_auth.js?rev=1036447&r1=1036446&r2=1036447&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/cookie_auth.js (original)
+++ couchdb/trunk/share/www/script/test/cookie_auth.js Thu Nov 18 13:20:14 2010
@@ -105,7 +105,7 @@ couchTests.cookie_auth = function(debug)
       T(CouchDB.session().userCtx.name == 'Jason Davies');
       
       // JSON login works
-      xhr = CouchDB.request("POST", "/_session", {
+      var xhr = CouchDB.request("POST", "/_session", {
         headers: {"Content-Type": "application/json"},
         body: JSON.stringify({
           name: 'Jason Davies',

Modified: couchdb/trunk/share/www/script/test/proxyauth.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/proxyauth.js?rev=1036447&r1=1036446&r2=1036447&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/proxyauth.js (original)
+++ couchdb/trunk/share/www/script/test/proxyauth.js Thu Nov 18 13:20:14 2010
@@ -56,7 +56,7 @@ couchTests.proxyauth = function(debug) {
     
     CouchDB.logout();
     
-    headers = {
+    var headers = {
       "X-Auth-CouchDB-UserName": "benoitc@apache.org",
       "X-Auth-CouchDB-Roles": "test",
       "X-Auth-CouchDB-Token": hex_hmac_sha1(secret, "benoitc@apache.org")
@@ -78,7 +78,7 @@ couchTests.proxyauth = function(debug) {
 
     db.save(designDoc);
     
-    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
+    var req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
                         {headers: headers});
     T(req.responseText == "Welcome benoitc@apache.org");
     
@@ -86,7 +86,7 @@ couchTests.proxyauth = function(debug) {
                         {headers: headers});
     T(req.responseText == "test");
     
-    xhr = CouchDB.request("PUT", "/_config/couch_httpd_auth/proxy_use_secret",{
+    var xhr = CouchDB.request("PUT", "/_config/couch_httpd_auth/proxy_use_secret",{
       body : JSON.stringify("true"),
       headers: {"X-Couch-Persist": "false"}
     });

Modified: couchdb/trunk/share/www/script/test/view_multi_key_design.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/view_multi_key_design.js?rev=1036447&r1=1036446&r2=1036447&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/view_multi_key_design.js (original)
+++ couchdb/trunk/share/www/script/test/view_multi_key_design.js Thu Nov 18 13:20:14 2010
@@ -112,7 +112,7 @@ couchTests.view_multi_key_design = funct
   }
 
   // Test that a map & reduce containing func support keys when reduce=false
-  resp = db.view("test/summate", {reduce: false}, keys);
+  var resp = db.view("test/summate", {reduce: false}, keys);
   T(resp.rows.length == 5);
 
   resp = db.view("test/summate", {reduce: false, keys: keys}, null);

Modified: couchdb/trunk/share/www/script/test/view_update_seq.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/view_update_seq.js?rev=1036447&r1=1036446&r2=1036447&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/view_update_seq.js (original)
+++ couchdb/trunk/share/www/script/test/view_update_seq.js Thu Nov 18 13:20:14 2010
@@ -18,7 +18,7 @@ couchTests.view_update_seq = function(de
 
   T(db.info().update_seq == 0);
 
-  resp = db.allDocs({update_seq:true});
+  var resp = db.allDocs({update_seq:true});
 
   T(resp.rows.length == 0);
   T(resp.update_seq == 0);



Mime
View raw message