mirror of
https://github.com/rails/jquery-rails.git
synced 2026-01-06 21:34:05 -05:00
Fix unescape_js to match changes in Action View
Unescapes dollar signs and backticks added by rails/rails@033a738817
This commit is contained in:
@@ -124,6 +124,8 @@ module Rails::Dom::Testing::Assertions::SelectorAssertions
|
||||
unescaped.gsub!('\n', "\n")
|
||||
unescaped.gsub!('\076', '>')
|
||||
unescaped.gsub!('\074', '<')
|
||||
unescaped.gsub!(/\\\$/, '$')
|
||||
unescaped.gsub!(/\\`/, '`')
|
||||
# js encodes non-ascii characters.
|
||||
unescaped.gsub!(PATTERN_UNICODE_ESCAPED_CHAR) {|u| [$1.hex].pack('U*')}
|
||||
unescaped
|
||||
|
||||
@@ -23,6 +23,8 @@ class AssertSelectJQueryTest < ActiveSupport::TestCase
|
||||
|
||||
// without semicolon
|
||||
$("#browser_cart").hide("blind", 1000)
|
||||
|
||||
$('#item').html('<div><span>\\`Total\\`: \\$12.34</span></div>');
|
||||
JS
|
||||
|
||||
setup do
|
||||
@@ -43,6 +45,10 @@ class AssertSelectJQueryTest < ActiveSupport::TestCase
|
||||
assert_select_jquery :remove, "#cart tr:not(.total_line) > *"
|
||||
assert_select_jquery :remove, "[href|=\"val\"][href$=\"val\"][href^=\"val\"]"
|
||||
assert_select_jquery :remove, "tr + td, li"
|
||||
|
||||
assert_select_jquery :html, '#item' do
|
||||
assert_select 'span', '`Total`: $12.34'
|
||||
end
|
||||
end
|
||||
|
||||
assert_raise Minitest::Assertion, "No JQuery call matches [:show, :some_wrong]" do
|
||||
|
||||
Reference in New Issue
Block a user