aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 9713506ad..d5f2bc0cf 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -276,6 +276,42 @@ test(".ajax() - headers" , function() {
});
+test(".ajax() - contentType" , function() {
+
+ expect( 2 );
+
+ stop();
+
+ var count = 2;
+
+ function restart() {
+ if ( ! --count ) {
+ start();
+ }
+ }
+
+ jQuery.ajax(url("data/headers.php?keys=content-type" ), {
+ contentType: "test",
+ success: function( data ) {
+ strictEqual( data , "content-type: test\n" , "Test content-type is sent when options.contentType is set" );
+ },
+ complete: function() {
+ restart();
+ }
+ });
+
+ jQuery.ajax(url("data/headers.php?keys=content-type" ), {
+ contentType: false,
+ success: function( data ) {
+ strictEqual( data , "content-type: \n" , "Test content-type is not sent when options.contentType===false" );
+ },
+ complete: function() {
+ restart();
+ }
+ });
+
+});
+
test(".ajax() - hash", function() {
expect(3);