Here you will actually want to call load. You have some logic in that method that should be tested. You can instead mock the $.ajax method and have it do nothing but call the success method that you pass in (with an appropriate response object).