Created
June 18, 2014 17:51
-
-
Save edshadi/897d070e4d7f34089778 to your computer and use it in GitHub Desktop.
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
var mockAjax = function() { | |
beforeEach(function() { | |
jasmine.Ajax.install(); | |
}) | |
afterEach(function() { | |
jasmine.Ajax.uninstall(); | |
}) | |
} | |
var lastRequest = function() { | |
return jasmine.Ajax.requests.mostRecent(); | |
} | |
var respondWithSuccess = function() { | |
lastRequest().response({ | |
"status": 200, | |
"contentType": "text./plain" | |
}); | |
} | |
var respondWithError = function() { | |
lastRequest().response({ | |
"status": 500, | |
"contentType": "text./plain" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment