Hi, Eric,
If I don't recover the value of the global variable Ajax, then
testUpdateAttributes will fail in IE 6. And I think we should provide
a tearDown function, it's a good practice.
Here is the full patch about jester.js and jester_test.html, very
graceful, all the tests passed in IE 6 and Firefox 2.
diff -r -w -b -B -u jester.orig/jester.js jester/jester.js
--- jester.orig/jester.js Sat May 3 04:24:43 2008
+++ jester/jester.js Wed Jul 9 10:18:53 2008
@@ -545,7 +545,8 @@
else {
var attributes;
if (this.klass._format == "json") {
- attributes =
this._attributesFromJSON(transport.responseText);
+ eval("var json = " + transport.responseText + ";");
+ attributes = this._attributesFromJSON(json);
}
else {
var doc = Jester.Tree.parseXML(transport.responseText);
diff -r -w -b -B -u jester.orig/test/jester_test.html jester/test/
jester_test.html
--- jester.orig/test/jester_test.html Sat May 3 04:24:43 2008
+++ jester/test/jester_test.html Wed Jul 9 10:25:59 2008
@@ -14,6 +14,8 @@
<body>
<script language="JavaScript" type="text/javascript">
+var old_ajax = Ajax;
+
function setUp () {
default_prefix = function() {return window.location.protocol + "//"
+ window.location.hostname + (window.location.port ? ":" +
window.location.port : "");}
@@ -182,6 +184,9 @@
return true;
}
+function tearDown() {
+ Ajax = old_ajax;
+}
/********************************************
************ FIND TESTS ********************
@@ -587,7 +592,7 @@
var eric = User.find(1);
newAttrs = {
'first_name' : 'todd',
- 'admin' : false,
+ 'admin' : false
}
oldAttrs = eric.attributes();
eric.setAttributes(newAttrs);
@@ -602,7 +607,7 @@