diff options
Diffstat (limited to 'actionpack/test/template')
-rwxr-xr-x | actionpack/test/template/date_helper_test.rb | 3 | ||||
-rw-r--r-- | actionpack/test/template/javascript_helper_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 20 |
3 files changed, 17 insertions, 14 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index 92a0a0a43e..c5b672a791 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -13,6 +13,9 @@ class DateHelperTest < Test::Unit::TestCase def id_before_type_cast 123 end + def to_param + '123' + end end end diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb index eb4bedd1ed..8de1daaeaa 100644 --- a/actionpack/test/template/javascript_helper_test.rb +++ b/actionpack/test/template/javascript_helper_test.rb @@ -38,14 +38,14 @@ class JavaScriptHelperTest < Test::Unit::TestCase html = link_to_function( "Greet me!" ) do |page| page.replace_html 'header', "<h1>Greetings</h1>" end - assert_dom_equal %(<a href="#" onclick="Element.update("header", "\\074h1\\076Greetings\\074/h1\\076");; return false;">Greet me!</a>), html + assert_dom_equal %(<a href="#" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");; 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("header", "\\074h1\\076Greetings\\074/h1\\076");; return false;">Greet me!</a>), html + assert_dom_equal %(<a href="#" class="updater" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");; return false;">Greet me!</a>), html end def test_link_to_function_with_href @@ -67,14 +67,14 @@ class JavaScriptHelperTest < Test::Unit::TestCase 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("header", "\\074h1\\076Greetings\\074/h1\\076");;" value="Greet me!" />), html + assert_dom_equal %(<input type="button" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");;" 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("header", "\\074h1\\076Greetings\\074/h1\\076");;" value="Greet me!" />), html + assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");;" value="Greet me!" />), html end def test_button_to_function_with_onclick diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 3df1502f12..bdb7a848a0 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -303,23 +303,23 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase end def test_insert_html_with_string - assert_equal 'new Insertion.Top("element", "\\074p\\076This is a test\\074/p\\076");', + 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", "\\074p\076This is a test\\074/p\076");', + 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", "\\074p\076This is a test\\074/p\076");', + 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", "\\074p\076This is a test\\074/p\076");', + 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", "\\074p\\076This is a test\\074/p\\076");', + 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", "\\074div id=\"element\"\\076\\074p\\076This is a test\\074/p\\076\\074/div\\076");', + 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 @@ -356,7 +356,7 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase end def test_redirect_to - assert_equal 'window.location.href = "http://www.example.com/welcome";', + assert_equal 'window.location.href = "http:\\/\\/www.example.com\\/welcome";', @generator.redirect_to(:action => 'welcome') end @@ -375,10 +375,10 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase @generator.replace_html('baz', '<p>This is a test</p>') assert_equal <<-EOS.chomp, @generator.to_s -new Insertion.Top("element", "\\074p\\076This is a test\\074/p\\076"); -new Insertion.Bottom("element", "\\074p\\076This is a test\\074/p\\076"); +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", "\\074p\\076This is a test\\074/p\\076"); +Element.update("baz", "\\074p\\076This is a test\\074\\/p\\076"); EOS end |