You could create some function (say window.GiveMeUrlForAjax) that
returns uri for ajax request, your test could then easily overwrite
that function before triggering event to perform ajax. Also you might
consider creating a function that returns data (in production it would
take url from
I would just wrap the method that makes the ajax call and spec it from
Jasmine. Then you can just stub the wrapper to return the data you
want and expect the right thing to happen in the callback method (or
however the data gets stored/displayed.)
On Wed, Sep 26, 2012 at 10:26 AM, Ervin Weber