couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r986710 - in /couchdb/trunk/share/www/script: couch.js test/attachment_paths.js
Date Wed, 18 Aug 2010 14:44:08 GMT
Author: jan
Date: Wed Aug 18 14:44:07 2010
New Revision: 986710

URL: http://svn.apache.org/viewvc?rev=986710&view=rev
Log:
Fix test suite for Chrome and Safari.

couch.js patch by Robert Newson.

Modified:
    couchdb/trunk/share/www/script/couch.js
    couchdb/trunk/share/www/script/test/attachment_paths.js

Modified: couchdb/trunk/share/www/script/couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch.js?rev=986710&r1=986709&r2=986710&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/couch.js [utf-8] Wed Aug 18 14:44:07 2010
@@ -397,8 +397,8 @@ CouchDB.newXhr = function() {
 }
 
 CouchDB.request = function(method, uri, options) {
-  options = options || {};
-  options.headers = options.headers || {};
+  options = typeof(options) == 'object' ? options : {};
+  options.headers = typeof(options.headers) == 'object' ? options.headers : {};
   options.headers["Content-Type"] = options.headers["Content-Type"] || options.headers["content-type"]
|| "application/json";
   options.headers["Accept"] = options.headers["Accept"] || options.headers["accept"] || "application/json";
   var req = CouchDB.newXhr();

Modified: couchdb/trunk/share/www/script/test/attachment_paths.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/attachment_paths.js?rev=986710&r1=986709&r2=986710&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/attachment_paths.js (original)
+++ couchdb/trunk/share/www/script/test/attachment_paths.js Wed Aug 18 14:44:07 2010
@@ -73,7 +73,10 @@ couchTests.attachment_paths = function(d
     T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
     T(binAttDoc._attachments["foo%2Fbaz.txt"] !== undefined);
     T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
-    T(binAttDoc._attachments["foo/bar2.txt"].content_type == "text/plain;charset=utf-8");
+    TEquals("text/plain;charset=utf-8",                   // thank you Safari
+      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
+      "correct content-type"
+    );
     T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
 
     //// now repeat the while thing with a design doc
@@ -141,7 +144,10 @@ couchTests.attachment_paths = function(d
 
     T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
     T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
-    T(binAttDoc._attachments["foo/bar2.txt"].content_type == "text/plain;charset=utf-8");
+    TEquals("text/plain;charset=utf-8",                   // thank you Safari
+      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
+      "correct content-type"
+    );
     T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
   }
 };



Mime
View raw message