You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by be...@apache.org on 2008/07/05 22:16:49 UTC

svn commit: r674233 - /incubator/shindig/trunk/features/core.io/iotest.js

Author: beaton
Date: Sat Jul  5 13:16:48 2008
New Revision: 674233

URL: http://svn.apache.org/viewvc?rev=674233&view=rev
Log:
Add a test for repeated GET requests for same resource.

Modified:
    incubator/shindig/trunk/features/core.io/iotest.js

Modified: incubator/shindig/trunk/features/core.io/iotest.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core.io/iotest.js?rev=674233&r1=674232&r2=674233&view=diff
==============================================================================
--- incubator/shindig/trunk/features/core.io/iotest.js (original)
+++ incubator/shindig/trunk/features/core.io/iotest.js Sat Jul  5 13:16:48 2008
@@ -169,6 +169,34 @@
   this.assertEquals('some data', resp.text);
 };
 
+// Make sure we don't accidentally include any cache-busting parameters
+// in our GET requests
+IoTest.prototype.testRepeatGet = function() {
+  var req = new fakeXhr.Expectation("GET", "http://www.example.com/json");
+  this.setStandardArgs(req, false);
+  req.setQueryArg("url", "http://target.example.com/somepage");
+
+  var resp = this.makeFakeResponse(
+      "{ 'http://target.example.com/somepage' : { 'body' : 'some data' }}");
+
+  this.fakeXhrs.expect(req, resp);
+  this.fakeXhrs.expect(req, resp);
+
+  var resp = null;
+  gadgets.io.makeRequest("http://target.example.com/somepage",
+      function(data) {
+        resp = data;
+      });
+  this.assertEquals('some data', resp.text);
+
+  resp = null;
+  gadgets.io.makeRequest("http://target.example.com/somepage",
+      function(data) {
+        resp = data;
+      });
+  this.assertEquals('some data', resp.text);
+};
+
 IoTest.prototype.testPost = function() {
   var req = new fakeXhr.Expectation("POST", "http://www.example.com/json");
   this.setStandardArgs(req, true);