Last active
August 29, 2015 14:04
-
-
Save kyeh/c929a9e08ec3e8125897 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
test("Using the deferred to trigger done for success status", function() { | |
// ... | |
submitCancel(); | |
QUnit.equal($('#cancel-status').text(), ''); | |
// resolving the deferred with an object with the status | |
deferred.resolve({status: "success"}); | |
QUnit.equal($('#cancel-status').text(), 'cancel status: cancel finished'); | |
}); | |
test("Using the deferred to trigger done for not-found status", function() { | |
// ... | |
submitCancel(); | |
QUnit.equal($('#cancel-status').text(), ''); | |
// resolving the deferred again with a different status | |
deferred.resolve({status: "cancel postponed"}); | |
QUnit.equal($('#cancel-status').text(), 'cancel status: cancel postponed'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment