<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+== 0.8.1 2008-10-09
+
+* jQuery's Test.Ajax only invokes the mocked url, not all urls that were mocked
+
 == 0.8.0 2008-04-13
 
 * jQuery.ajax mocking</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ require 'rake/packagetask'
 
 $:.unshift File.dirname(__FILE__) + &quot;/lib&quot;
 
-APP_VERSION  = '0.8.0'
+APP_VERSION  = '0.8.1'
 APP_NAME     = 'drnic_js_test_helpers'
 RUBYFORGE_PROJECT = 'drnicutilities'
 APP_FILE_NAME= &quot;#{APP_NAME}.js&quot;</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -30,18 +30,15 @@ if (typeof jQuery != &quot;undefined&quot;) {
         $.ajaxOrig = $.ajax;
         $.ajax = function(options) {
           var response = {};
-          var found    = false;
-          for (var url in Test.Ajax.MockedRequests) {
-            var mock = Test.Ajax.MockedRequests[url];
-            if (!found &amp;&amp; mock) {
-              mock(options, response);
-              found = true;
-            }
-          };
-          if (!found) {
+          var mock = Test.Ajax.MockedRequests[options];
+          if (!mock) {
+            mock = Test.Ajax.MockedRequests[options.url];
+          }
+          if (mock) {
+            mock(options, response);
+          } else {
             return $.ajaxOrig(options);
           }
-          
         };
       }
     };</diff>
      <filename>src/ajax_mock/jquery.js</filename>
    </modified>
    <modified>
      <diff>@@ -88,7 +88,22 @@
         assert(self.failed, 'onFailure should have been called');
       });
     }},
+    
+    &quot;test that only on ajax callback invoked if multiple mocks&quot;: function() { with(this) {
+      var one_called = false;
+      var two_called = false;
+      Test.Ajax.setupMock(&quot;/one&quot;, function(request, response) {
+        one_called = true;
+      });
+      Test.Ajax.setupMock(&quot;/two&quot;, function(request, response) {
+        two_called = true;
+      });
+      $.get('/two');
+      assert(!one_called, '/one should not be invoked');
+      assert(two_called);
+    }},
 
+    
   });
 // ]]&gt;
 &lt;/script&gt;</diff>
      <filename>test/unit/ajax_mock_jquery_test.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1b61b0dfe0f216e3d0b9ad93ad636d6bc4e99f92</id>
    </parent>
  </parents>
  <author>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </author>
  <url>http://github.com/drnic/drnic_js_test_helpers/commit/93973972cacb3cfa74d3f6747ed885f7f8389c56</url>
  <id>93973972cacb3cfa74d3f6747ed885f7f8389c56</id>
  <committed-date>2008-10-08T21:20:31-07:00</committed-date>
  <authored-date>2008-10-08T21:20:31-07:00</authored-date>
  <message>0.8.1 jQuery's Test.Ajax only invokes the mocked url, not all urls that were mocked</message>
  <tree>999f76ee8cd45fca6cfdb1f90cd64e0551e1fe04</tree>
  <committer>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </committer>
</commit>
