Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed up test for novalidate attribute

  • Loading branch information...
commit cd619df9f0daad3303aacd4f992fff19158b1e5d 1 parent 36a81a3
@JangoSteve JangoSteve authored
Showing with 7 additions and 13 deletions.
  1. +7 −13 test/public/test/call-remote-callbacks.js
View
20 test/public/test/call-remote-callbacks.js
@@ -120,7 +120,7 @@ asyncTest('form should be submitted with blank required fields if handler is bou
}, 13);
});
-asyncTest('disabled fields should not be included in blank required check', 1, function() {
+asyncTest('disabled fields should not be included in blank required check', 2, function() {
var form = $('form[data-remote]')
.append($('<input type="text" name="user_name" required="required" disabled="disabled">'))
.append($('<textarea name="user_bio" required="required" disabled="disabled"></textarea>'))
@@ -129,12 +129,9 @@ asyncTest('disabled fields should not be included in blank required check', 1, f
})
.bind('ajax:aborted:required', function() {
ok(false, 'ajax:aborted:required should not run');
- })
- .trigger('submit');
+ });
- setTimeout(function() {
- start();
- }, 13);
+ submit();
});
asyncTest('form should be submitted with blank required fields if it has the "novalidate" attribute', 2, function(){
@@ -144,14 +141,11 @@ asyncTest('form should be submitted with blank required fields if it has the "no
.bind('ajax:beforeSend', function() {
ok(true, 'ajax:beforeSend should run');
})
- .bind('ajax:complete', function() {
- ok(true, 'ajax:complete should run')
- })
- .trigger('submit');
+ .bind('ajax:aborted:required', function() {
+ ok(false, 'ajax:aborted:required should not run');
+ });
- setTimeout(function() {
- start();
- }, 13);
+ submit();
});
asyncTest('blank required form input for non-remote form with "novalidate" attribute should not abort normal submission', 1, function() {
Please sign in to comment.
Something went wrong with that request. Please try again.