Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("SinonMockJQAjaxWithJasmine", function() {
- it("should mock a jQuery ajax request", sinon.test(function () {
- this.mock(jQuery).expects("ajax").once();
- jQuery.ajax({
- url: "/something"
- });
- }));
- it("should fail when expectations are not met", sinon.test(function () {
- this.mock(jQuery).expects("ajax").twice();
- jQuery.ajax({
- url: "/something"
- });
- }));
- });
Add Comment
Please, Sign In to add comment