Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix unescaped test expectations. Closes #9821 [mikel]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@7806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 5e281e9c1d7378144a9c1f720b840a9b220cbf73 1 parent 52aeab4
@jeremy jeremy authored
View
8 actionpack/test/template/javascript_helper_test.rb
@@ -36,14 +36,14 @@ def test_link_to_function_with_rjs_block
html = link_to_function( "Greet me!" ) do |page|
page.replace_html 'header', "<h1>Greetings</h1>"
end
- assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html
+ assert_dom_equal %q(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);; return false;">Greet me!</a>), html
end
def test_link_to_function_with_rjs_block_and_options
html = link_to_function( "Greet me!", :class => "updater" ) do |page|
page.replace_html 'header', "<h1>Greetings</h1>"
end
- assert_dom_equal %(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html
+ assert_dom_equal %q(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);; return false;">Greet me!</a>), html
end
def test_button_to_function
@@ -55,13 +55,13 @@ def test_button_to_function_with_rjs_block
html = button_to_function( "Greet me!" ) do |page|
page.replace_html 'header', "<h1>Greetings</h1>"
end
- assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html
+ assert_dom_equal %q(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);;" value="Greet me!" />), html
end
def test_button_to_function_with_rjs_block_and_options
html = button_to_function( "Greet me!", :class => "greeter" ) do |page|
page.replace_html 'header', "<h1>Greetings</h1>"
end
- assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html
+ assert_dom_equal %q(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);;" value="Greet me!" />), html
end
end
View
22 actionpack/test/template/prototype_helper_test.rb
@@ -170,23 +170,23 @@ def setup
end
def test_insert_html_with_string
- assert_equal 'new Insertion.Top("element", "<p>This is a test</p>");',
+ assert_equal 'new Insertion.Top("element", "\074p\076This is a test\074/p\076");',
@generator.insert_html(:top, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.Bottom("element", "<p>This is a test</p>");',
+ assert_equal 'new Insertion.Bottom("element", "\074p\076This is a test\074/p\076");',
@generator.insert_html(:bottom, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.Before("element", "<p>This is a test</p>");',
+ assert_equal 'new Insertion.Before("element", "\074p\076This is a test\074/p\076");',
@generator.insert_html(:before, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.After("element", "<p>This is a test</p>");',
+ assert_equal 'new Insertion.After("element", "\074p\076This is a test\074/p\076");',
@generator.insert_html(:after, 'element', '<p>This is a test</p>')
end
def test_replace_html_with_string
- assert_equal 'Element.update("element", "<p>This is a test</p>");',
+ assert_equal 'Element.update("element", "\074p\076This is a test\074/p\076");',
@generator.replace_html('element', '<p>This is a test</p>')
end
def test_replace_element_with_string
- assert_equal 'Element.replace("element", "<div id=\"element\"><p>This is a test</p></div>");',
+ assert_equal 'Element.replace("element", "\074div id=\"element\"\076\074p\076This is a test\074/p\076\074/div\076");',
@generator.replace('element', '<div id="element"><p>This is a test</p></div>')
end
@@ -241,12 +241,12 @@ def test_to_s
@generator.remove('foo', 'bar')
@generator.replace_html('baz', '<p>This is a test</p>')
- assert_equal <<-EOS.chomp, @generator.to_s
-new Insertion.Top("element", "<p>This is a test</p>");
-new Insertion.Bottom("element", "<p>This is a test</p>");
+ expected = %q(new Insertion.Top("element", "\074p\076This is a test\074/p\076");
+new Insertion.Bottom("element", "\074p\076This is a test\074/p\076");
["foo", "bar"].each(Element.remove);
-Element.update("baz", "<p>This is a test</p>");
- EOS
+Element.update("baz", "\074p\076This is a test\074/p\076");)
+
+ assert_equal expected, @generator.to_s
end
def test_element_access
Please sign in to comment.
Something went wrong with that request. Please try again.