Skip to content

Instantly share code, notes, and snippets.

@leviwilson
Created November 10, 2011 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leviwilson/1355128 to your computer and use it in GitHub Desktop.
Save leviwilson/1355128 to your computer and use it in GitHub Desktop.
Jasmine Any Matcher
describe("testing a Backbone fetch", function () {
beforeEach(function () {
spyOn($, 'ajax');
});
it("should have been called with this", function () {
var sut = new MyModel({});
sut.fetch();
var ajaxOptions = { type: 'GET', dataType: 'json', success: undefined, error: jasmine.any(Function), url: '/MyModel' };
expect($.ajax).toHaveBeenCalledWith(ajaxOptions);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment