pivotal/jasmine-ajax — pull request #46 by brianpilati (2014-02-20 00:09:31+00:00)
Title: Added support for getJSON and getScript

I am working on a project that uses getJSON and getScript and I needed to mock them out. So I added the functionality and tests to v1.3.1. I had to include a "promise" method to get everything to work.

Here is the basic premise

var uri = "http://getJSON.example.com";
var callBack = jasmine.createSpy('onSuccess');
var data = undefined;

jasmine.Ajax.useMock();
$.getJSON(uri, data, callback);
request = mostRecentAjaxRequest();
request.promise(TestResponses);

expect(request.url).toBe(uri);
expect(callBack).toHaveBeenCalled();

I admit that I am not an expect for jQuery, so I hope you are pleased with the results. I have the new library working in the other project.

If/when you except the pull request, I will update the README and port the code over to 2.0rc.

--Cheers
Brian