title: Jasmine Error: Expected spy decode to have been called with [ [ ] ] but actual calls were [ undefined ]
body: <p>I'm trying to learn Ext JS and unit testing with Jasmine framework. I wrote this method and I want to test if <code>decode</code> method is being called with a certain value, but I keep getting the error mentioned in the caption. What am I doing wrong here?</p>
  
  <p>The method:</p>
  
  <pre><code>onSuccess: function (response) {
      var text = Ext.decode(response.responseText);
      this.someGrid.store.loadRawData(text);
  }
  </code></pre>
  
  <p>Jasmine spec:</p>
  
  <pre><code>it('Function will call decode method', function () {
      var response = {};
      spyOn(Ext, 'decode').and.returnValue([]);
      me.testObj.onSuccess(response);
      expect(Ext.decode).toHaveBeenCalledWith([]);
  })
  </code></pre>