git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved docs for removeClass (optional parameter, removes all classes if not specified)
[jquery.git]
/
src
/
ajax
/
ajaxTest.js
diff --git
a/src/ajax/ajaxTest.js
b/src/ajax/ajaxTest.js
index
1cd072f
..
f530c1c
100644
(file)
--- a/
src/ajax/ajaxTest.js
+++ b/
src/ajax/ajaxTest.js
@@
-44,8
+44,9
@@
test("synchronous request", function() {
});
test("synchronous request with callbacks", function() {
});
test("synchronous request with callbacks", function() {
+ expect(2);
var result;
var result;
- $.ajax({url: "data/json.php", async: false, success: function(data) { result = data; } });
+ $.ajax({url: "data/json.php", async: false, success: function(data) { ok(true, "sucess callback executed"); result = data; } });
ok( /^{ "data"/.test( result ), "check returned text" );
});
ok( /^{ "data"/.test( result ), "check returned text" );
});
@@
-127,6
+128,7
@@
test("test global handlers - failure", function() {
counter.error = counter.success = counter.complete = counter.send = 0;
$.ajaxTimeout(500);
$.ajax({url: "data/name.php?wait=5", global: false, beforeSend: send, success: success, error: error, complete: function() {
counter.error = counter.success = counter.complete = counter.send = 0;
$.ajaxTimeout(500);
$.ajax({url: "data/name.php?wait=5", global: false, beforeSend: send, success: success, error: error, complete: function() {
+ var x = counter;
ok( counter.error == 1, 'Check failed request without globals' );
ok( counter.success == 0, 'Check failed request without globals' );
ok( counter.complete == 0, 'Check failed request without globals' );
ok( counter.error == 1, 'Check failed request without globals' );
ok( counter.success == 0, 'Check failed request without globals' );
ok( counter.complete == 0, 'Check failed request without globals' );
@@
-331,4
+333,17
@@
test("$.ajax - beforeSend", function() {
start();
}
});
start();
}
});
-});
\ No newline at end of file
+});
+
+test("ajaxSetup()", function() {
+ expect(1);
+ stop();
+ $.ajaxSetup({
+ url: "data/name.php?name=foo",
+ success: function(msg){
+ ok( msg == 'bar', 'Check for GET' );
+ start();
+ }
+ });
+ $.ajax();
+});