Skip to content
Permalink
Browse files

Disabled the Ajax tests from running locally.

  • Loading branch information
jeresig committed Sep 23, 2007
1 parent 595d125 commit b45325765327d257f00b55cd5383287c1bd94875
Showing with 57 additions and 55 deletions.
  1. +31 −33 test/unit/ajax.js
  2. +26 −22 test/unit/core.js
@@ -5,6 +5,8 @@ module("ajax");
// tests and they'll pass
//if ( !jQuery.browser.safari ) {

if ( !isLocal ) {

test("$.ajax() - success callbacks", function() {
expect( 8 );

@@ -38,37 +40,35 @@ test("$.ajax() - success callbacks", function() {
}, 13);
});

if ( !isLocal ) {
test("$.ajax() - error callbacks", function() {
expect( 8 );
stop();

$('#foo').ajaxStart(function(){
ok( true, "ajaxStart" );
}).ajaxStop(function(){
ok( true, "ajaxStop" );
start();
}).ajaxSend(function(){
ok( true, "ajaxSend" );
}).ajaxComplete(function(){
ok( true, "ajaxComplete" );
}).ajaxError(function(){
ok( true, "ajaxError" );
}).ajaxSuccess(function(){
ok( false, "ajaxSuccess" );
});

$.ajaxSetup({ timeout: 500 });

$.ajax({
url: url("data/name.php?wait=5"),
beforeSend: function(){ ok(true, "beforeSend"); },
success: function(){ ok(false, "success"); },
error: function(){ ok(true, "error"); },
complete: function(){ ok(true, "complete"); }
});
});
}
test("$.ajax() - error callbacks", function() {
expect( 8 );
stop();

$('#foo').ajaxStart(function(){
ok( true, "ajaxStart" );
}).ajaxStop(function(){
ok( true, "ajaxStop" );
start();
}).ajaxSend(function(){
ok( true, "ajaxSend" );
}).ajaxComplete(function(){
ok( true, "ajaxComplete" );
}).ajaxError(function(){
ok( true, "ajaxError" );
}).ajaxSuccess(function(){
ok( false, "ajaxSuccess" );
});

$.ajaxSetup({ timeout: 500 });

$.ajax({
url: url("data/name.php?wait=5"),
beforeSend: function(){ ok(true, "beforeSend"); },
success: function(){ ok(false, "success"); },
error: function(){ ok(true, "error"); },
complete: function(){ ok(true, "complete"); }
});
});

test("$.ajax() - disabled globals", function() {
expect( 3 );
@@ -346,8 +346,6 @@ test("$.getScript(String, Function) - no callback", function() {
$.getScript(url("data/test.js"), start);
});

if ( !isLocal ) {

test("$.ajax() - JSONP, Local", function() {
expect(7);

@@ -213,15 +213,17 @@ test("attr(String)", function() {
ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );
});

test("attr(String) in XML Files", function() {
expect(2);
stop();
$.get("data/dashboard.xml", function(xml) {
ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
start();
});
});
if ( !isLocal ) {
test("attr(String) in XML Files", function() {
expect(2);
stop();
$.get("data/dashboard.xml", function(xml) {
ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
start();
});
});
}

test("attr(String, Function)", function() {
expect(2);
@@ -286,19 +288,21 @@ test("attr(String, Object)", function() {
equals( "checkbox", $(check).attr('type'), "Verify that you can change the type of an input element that isn't in the DOM" );
});

test("attr(String, Object) - Loaded via XML document", function() {
expect(2);
stop();
$.get('data/dashboard.xml', function(xml) {
var titles = [];
$('tab', xml).each(function() {
titles.push($(this).attr('title'));
});
ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );
ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );
start();
});
});
if ( !isLocal ) {
test("attr(String, Object) - Loaded via XML document", function() {
expect(2);
stop();
$.get('data/dashboard.xml', function(xml) {
var titles = [];
$('tab', xml).each(function() {
titles.push($(this).attr('title'));
});
ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );
ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );
start();
});
});
}

test("css(String|Hash)", function() {
expect(19);

0 comments on commit b453257

Please sign in to comment.
You can’t perform that action at this time.