title: ExtJS 4.2.1 mocking Ext.Ajax.request
body: <p>For frontend unit testing with jasmine i want to mock all my requests in my application. </p>
  
  <p>I've already implemented a method to mock all my proxies.</p>
  
  <pre><code>proxy: appname.classes.proxy.ProxyNegotiator.getModelProxy("User")
  </code></pre>
  
  <p>and this method does something like this:</p>
  
  <pre><code>getModelProxy: function(config) {
      var url = this.getUrl(config);
  
      if (this.getProxyType() == 'api') {
          return appname.classes.proxy.WebApiProxy.getModelProxy(url);
      } else if (this.getProxyType() == 'test') {
          return appname.classes.proxy.LocalTestProxy.getModelProxy(url);
      }
      return undefined;
  }
  </code></pre>
  
  <p>so you can imagine depending on my ProxyType configuration i get the web api proxy or the local proxy for testing. I do now have covered my crud operations..</p>
  
  <p>Still, i do have another issue to deal with..
  I do have some other requests in my application like this (validation of the username):</p>
  
  <pre><code>//check if Username is Valid
  Ext.Ajax.request({
      url: '/api/User',
      method: 'GET',
      async: false,
      params: { id: user.get('Id'), username: user.get('UserName') },
      failure: function(response, opts) {
          myErrors.push({
              field: 'UserName',
              message: appname.locale.ErrorInvalidUsername
          });
      }
  });
  </code></pre>
  
  <p>I do have some troubles with mocking this Ext.Ajax.request things... I've already searched in the web and did not find any nice solution for this.
  Whats best practice to mock this request? I am glad about every hint and/or idea u can give me. Please HELP!</p>