aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-22 12:52:44 -0400
committerJohn Resig <jeresig@gmail.com>2010-09-22 12:52:44 -0400
commitf9f9ee52e16f37900296e06982a7dccba89c5a78 (patch)
tree7bed802c84cc5f42e5746f72bf4c29534d7820df /test/unit/ajax.js
parenta32f4d7b6c197bcb521c7b0d351328f3821b6fee (diff)
downloadjquery-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.js29
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();