Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed blank form href test for IE.

  • Loading branch information...
commit 0e742688c633bda274f8a09bf3248ffe33ecaf92 1 parent 1ebfd86
@JangoSteve JangoSteve authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 test/public/test/call-remote.js
View
14 test/public/test/call-remote.js
@@ -84,17 +84,23 @@ asyncTest('allow empty "data-remote" attribute', 1, function() {
});
asyncTest('allow empty form "action"', 1, function() {
+ var currentLocation, ajaxLocation;
+
build_form({ action: '' });
$('#qunit-fixture').find('form')
.bind('ajax:beforeSend', function(e, xhr, settings) {
// Get current location (the same way jQuery does)
- var currentLocation = document.createElement( "a" );
- currentLocation.href = "";
- currentLocation = currentLocation.href;
+ try {
+ currentLocation = location.href;
+ } catch(e) {
+ currentLocation = document.createElement( "a" );
+ currentLocation.href = "";
+ currentLocation = currentLocation.href;
+ }
// Actual location (strip out settings.data that jQuery serializes and appends)
- var ajaxLocation = settings.url.replace(settings.data,"").replace(/&$/, "");
+ ajaxLocation = settings.url.replace(settings.data,"").replace(/&$/, "");
equal(ajaxLocation.match(/^(.*)/)[1], currentLocation, 'URL should be current page by default');
// Prevent the request from actually getting sent to the current page and
Please sign in to comment.
Something went wrong with that request. Please try again.