diff options
author | John Resig <jeresig@gmail.com> | 2010-09-22 12:52:44 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-09-22 12:52:44 -0400 |
commit | f9f9ee52e16f37900296e06982a7dccba89c5a78 (patch) | |
tree | 7bed802c84cc5f42e5746f72bf4c29534d7820df /test/unit/ajax.js | |
parent | a32f4d7b6c197bcb521c7b0d351328f3821b6fee (diff) | |
download | jquery-f9f9ee52e16f37900296e06982a7dccba89c5a78.tar.gz jquery-f9f9ee52e16f37900296e06982a7dccba89c5a78.zip |
Make sure that #... are trimmed from Ajax request URLs. Fixes #4987.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 7f3f39aff..b7eb57d8e 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -68,6 +68,35 @@ test("jQuery.ajax() - error callbacks", function() { }); }); +test(".ajax() - hash", function() { + expect(3); + + jQuery.ajax({ + url: "data/name.html#foo", + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html", "Make sure that the URL is trimmed."); + return false; + } + }); + + jQuery.ajax({ + url: "data/name.html?abc#foo", + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html?abc", "Make sure that the URL is trimmed."); + return false; + } + }); + + jQuery.ajax({ + url: "data/name.html?abc#foo", + data: { "test": 123 }, + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html?abc&test=123", "Make sure that the URL is trimmed."); + return false; + } + }); +}); + test(".ajax() - 304", function() { expect( 1 ); stop(); |