Permalink
Browse files

This test was failing for me on all versions of jQuery because the wr…

…ong event was being triggered on the wrong element.

The 'submit' event was being bound via the 'live' call and this doesn't happen on the 'input' element, but rather it's form. Just locate the form instead and trigger the 'submit' event on it to simulate clicking the submit button.
  • Loading branch information...
alexcrichton authored and josevalim committed Oct 19, 2010
1 parent 4407a48 commit 635c711ad54365120ac99a44456fc089b12c8628
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/public/test/data-disable.js
@@ -58,9 +58,9 @@ test('clicking on non-ajax Submit input tag with data-disable-with attribute', f
equals($('input:disabled').size(), 0, 'input field should not be disabled');
equals($('input[type=submit]').val(), 'Submit', 'input field should have value given to it');
- $('form:not([data-disable-with])').live('submit', function (e) {
+ $('form:not([data-remote])').live('submit', function (e) {
e.preventDefault();
- }).trigger('click');
+ }).trigger('submit');
equals($('input:disabled').size(), 1, 'input field should be disabled');
equals($('input:disabled').val(), 'submitting ...', 'input field should have disabled value given to it');

0 comments on commit 635c711

Please sign in to comment.