In JavaScript, whitespace is permitted between chained function calls, like so:
$('#new_subscription')
.append("<p class=\"message success\"><i class=\"fa fa-check\"></i> You’ve been added to the mailing list. Thanks!</p>")
.find('input[type=email]')
.val('');
The following assertion using assert_select_jquery fails on the above example with the latest version of the jquery-rails gem:
assert_select_jquery :append, '#new_subscription'
The assertion fails because assert_select_jquery assumes no whitespace between the jQuery call and the append method call. This pull request modifies the regular expression generated in assert_select_jquery to permit legal whitespace.
In JavaScript, whitespace is permitted between chained function calls, like so:
The following assertion using
assert_select_jquery
fails on the above example with the latest version of thejquery-rails
gem:The assertion fails because
assert_select_jquery
assumes no whitespace between the jQuery call and theappend
method call. This pull request modifies the regular expression generated inassert_select_jquery
to permit legal whitespace.