Created
June 14, 2011 13:38
-
-
Save mataspetrikas/1024911 to your computer and use it in GitHub Desktop.
Mockjax remote jsonp failure
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
asyncTest('Response returns jsonp', function() { | |
$.mockjax({ | |
url: 'http://example.com/jsonp*', | |
contentType: 'text/json', | |
proxy: 'test_jsonp.js' | |
}); | |
window.abcdef123456 = function(json) { | |
ok( true, 'JSONP Callback executed'); | |
deepEqual(json, { "data" : "JSONP is cool" }); | |
}; | |
$.ajax({ | |
url: 'http://example.com/jsonp?callback=?', | |
jsonpCallback: 'abcdef123456', | |
dataType: 'jsonp', | |
error: noErrorCallbackExpected, | |
complete: function(xhr) { | |
equals(xhr.getResponseHeader('Content-Type'), 'text/json', 'Content type of text/json'); | |
start(); | |
} | |
}); | |
$.mockjaxClear(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment