mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-24 12:13:59 +01:00
* Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351)
This commit is contained in:
@@ -366,7 +366,7 @@ test("accept", function() {
|
||||
});
|
||||
|
||||
test("remote", function() {
|
||||
expect(5);
|
||||
expect(7);
|
||||
stop();
|
||||
var e = $("#username");
|
||||
var v = $("#userForm").validate({
|
||||
@@ -387,14 +387,21 @@ test("remote", function() {
|
||||
}
|
||||
});
|
||||
$().ajaxStop(function() {
|
||||
ok( true, "There needs to be exactly one request." );
|
||||
equals( 1, v.size(), "There must be one error" );
|
||||
equals( "asdf in use", v.errorList[0].message );
|
||||
$().unbind("ajaxStop");
|
||||
start();
|
||||
equals( 1, v.size(), "There must be one error" );
|
||||
equals( "Peter in use", v.errorList[0].message );
|
||||
|
||||
$().ajaxStop(function() {
|
||||
$().unbind("ajaxStop");
|
||||
equals( 1, v.size(), "There must be one error" );
|
||||
equals( "Peter2 in use", v.errorList[0].message );
|
||||
start();
|
||||
});
|
||||
e.val("Peter2");
|
||||
ok( !v.element(e), "new value, new request" );
|
||||
});
|
||||
ok( !v.element(e), "invalid element, nothing entered yet" );
|
||||
e.val("asdf");
|
||||
e.val("Peter");
|
||||
ok( !v.element(e), "still invalid, because remote validation must block until it returns" );
|
||||
});
|
||||
|
||||
@@ -463,7 +470,6 @@ test("remote extensions", function() {
|
||||
ok( !v.element(e), "still invalid, because remote validation must block until it returns" );
|
||||
});
|
||||
|
||||
|
||||
module("additional methods");
|
||||
|
||||
test("phone (us)", function() {
|
||||
|
||||
Reference in New Issue
Block a user