Created
November 10, 2011 15:32
-
-
Save leviwilson/1355128 to your computer and use it in GitHub Desktop.
Jasmine Any Matcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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