Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
46219b57
Commit
46219b57
authored
Oct 01, 2011
by
Corey Frang
Committed by
timmywil
Oct 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Landing pull request 525. Fixing tests with qunit.
More Details: -
https://github.com/jquery/jquery/pull/525
parent
1ebced17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
ajax.js
test/unit/ajax.js
+23
-14
No files found.
test/unit/ajax.js
View file @
46219b57
...
@@ -251,7 +251,9 @@ test( "jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)", fun
...
@@ -251,7 +251,9 @@ test( "jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)", fun
jQuery
.
ajax
(
"data/name.html"
).
success
(
function
()
{
ok
(
true
,
"With only string URL argument"
);
}),
jQuery
.
ajax
(
"data/name.html"
).
success
(
function
()
{
ok
(
true
,
"With only string URL argument"
);
}),
jQuery
.
ajax
(
"data/name.html"
,
{}
).
success
(
function
()
{
ok
(
true
,
"With string URL param and map"
);
}),
jQuery
.
ajax
(
"data/name.html"
,
{}
).
success
(
function
()
{
ok
(
true
,
"With string URL param and map"
);
}),
jQuery
.
ajax
({
url
:
"data/name.html"
}
).
success
(
function
()
{
ok
(
true
,
"With only map"
);
})
jQuery
.
ajax
({
url
:
"data/name.html"
}
).
success
(
function
()
{
ok
(
true
,
"With only map"
);
})
).
then
(
start
,
start
);
).
always
(
functionunction
()
{
start
();
});
});
});
...
@@ -402,7 +404,9 @@ test(".ajax() - headers" , function() {
...
@@ -402,7 +404,9 @@ test(".ajax() - headers" , function() {
},
},
error
:
function
(){
ok
(
false
,
"error"
);
}
error
:
function
(){
ok
(
false
,
"error"
);
}
}).
then
(
start
,
start
);
}).
always
(
function
()
{
start
();
});
});
});
...
@@ -1130,7 +1134,9 @@ test("global ajaxSettings", function() {
...
@@ -1130,7 +1134,9 @@ test("global ajaxSettings", function() {
test
(
"load(String)"
,
function
()
{
test
(
"load(String)"
,
function
()
{
expect
(
1
);
expect
(
1
);
stop
();
// check if load can be called with only url
stop
();
// check if load can be called with only url
jQuery
(
"#first"
).
load
(
"data/name.html"
,
start
);
jQuery
(
"#first"
).
load
(
"data/name.html"
,
function
()
{
start
();
});
});
});
test
(
"load('url selector')"
,
function
()
{
test
(
"load('url selector')"
,
function
()
{
...
@@ -1633,7 +1639,9 @@ test("jQuery.ajax() - script by content-type", function() {
...
@@ -1633,7 +1639,9 @@ test("jQuery.ajax() - script by content-type", function() {
data
:
{
header
:
"ecma"
}
data
:
{
header
:
"ecma"
}
})
})
).
then
(
start
,
start
);
).
always
(
function
()
{
start
();
});
});
});
test
(
"jQuery.ajax() - json by content-type"
,
function
()
{
test
(
"jQuery.ajax() - json by content-type"
,
function
()
{
...
@@ -1741,7 +1749,7 @@ test("jQuery.post - data", 3, function() {
...
@@ -1741,7 +1749,7 @@ test("jQuery.post - data", 3, function() {
jQuery
.
when
(
jQuery
.
when
(
jQuery
.
post
(
url
(
"data/name.php"
),
{
xml
:
"5-2"
,
length
:
3
},
function
(
xml
)
{
jQuery
.
post
(
url
(
"data/name.php"
),
{
xml
:
"5-2"
,
length
:
3
},
function
(
xml
)
{
jQuery
(
"math"
,
xml
).
each
(
function
()
{
jQuery
(
"math"
,
xml
).
each
(
function
()
{
equals
(
jQuery
(
"calculation"
,
this
).
text
(),
"5-2"
,
"Check for XML"
);
equals
(
jQuery
(
"calculation"
,
this
).
text
(),
"5-2"
,
"Check for XML"
);
equals
(
jQuery
(
"result"
,
this
).
text
(),
"3"
,
"Check for XML"
);
equals
(
jQuery
(
"result"
,
this
).
text
(),
"3"
,
"Check for XML"
);
});
});
...
@@ -1760,12 +1768,9 @@ test("jQuery.post - data", 3, function() {
...
@@ -1760,12 +1768,9 @@ test("jQuery.post - data", 3, function() {
strictEqual
(
data
,
"test%5Blength%5D=7&test%5Bfoo%5D=bar"
,
"Check if a sub-object with a length param is serialized correctly"
);
strictEqual
(
data
,
"test%5Blength%5D=7&test%5Bfoo%5D=bar"
,
"Check if a sub-object with a length param is serialized correctly"
);
}
}
})
})
// The more compact then( start, start ) doesn't work in IE7
).
always
(
function
()
{
).
then
(
function
()
{
start
();
},
function
()
{
start
();
start
();
}
);
});
});
});
...
@@ -2158,7 +2163,7 @@ test( "jQuery.ajax - statusCode" , function() {
...
@@ -2158,7 +2163,7 @@ test( "jQuery.ajax - statusCode" , function() {
jQuery
.
ajax
(
url
(
uri
)
,
{
jQuery
.
ajax
(
url
(
uri
)
,
{
complete
:
function
(
jqXHR
)
{
complete
:
function
(
jqXHR
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
jqXHR
.
statusCode
(
createStatusCodes
(
"very late binding"
,
isSuccess
)
);
jqXHR
.
statusCode
(
createStatusCodes
(
"very late binding"
,
isSuccess
)
);
countComplete
();
countComplete
();
}
,
100
);
}
,
100
);
...
@@ -2169,7 +2174,7 @@ test( "jQuery.ajax - statusCode" , function() {
...
@@ -2169,7 +2174,7 @@ test( "jQuery.ajax - statusCode" , function() {
statusCode
:
createStatusCodes
(
"all (options)"
,
isSuccess
),
statusCode
:
createStatusCodes
(
"all (options)"
,
isSuccess
),
complete
:
function
(
jqXHR
)
{
complete
:
function
(
jqXHR
)
{
jqXHR
.
statusCode
(
createStatusCodes
(
"all (on complete)"
,
isSuccess
)
);
jqXHR
.
statusCode
(
createStatusCodes
(
"all (on complete)"
,
isSuccess
)
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
jqXHR
.
statusCode
(
createStatusCodes
(
"all (very late binding)"
,
isSuccess
)
);
jqXHR
.
statusCode
(
createStatusCodes
(
"all (very late binding)"
,
isSuccess
)
);
countComplete
();
countComplete
();
}
,
100
);
}
,
100
);
...
@@ -2246,7 +2251,9 @@ test("jQuery.ajax - transitive conversions", function() {
...
@@ -2246,7 +2251,9 @@ test("jQuery.ajax - transitive conversions", function() {
}
}
})
})
).
then
(
start
,
start
);
).
always
(
function
()
{
start
();
});
});
});
...
@@ -2274,7 +2281,9 @@ test("jQuery.ajax - overrideMimeType", function() {
...
@@ -2274,7 +2281,9 @@ test("jQuery.ajax - overrideMimeType", function() {
}
}
})
})
).
then
(
start
,
start
);
).
always
(
function
()
{
start
();
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment