@@ -46,33 +46,45 @@ def test_escape_javascript_with_safebuffer
4646 end
4747
4848 def test_button_to_function
49- assert_dom_equal %(<input type="button" onclick="alert('Hello world!');" value="Greeting" />) ,
50- button_to_function ( "Greeting" , "alert('Hello world!')" )
49+ assert_deprecated "button_to_function is deprecated and will be removed from Rails 4.0" do
50+ assert_dom_equal %(<input type="button" onclick="alert('Hello world!');" value="Greeting" />) ,
51+ button_to_function ( "Greeting" , "alert('Hello world!')" )
52+ end
5153 end
5254
5355 def test_button_to_function_with_onclick
54- assert_dom_equal "<input onclick=\" alert('Goodbye World :('); alert('Hello world!');\" type=\" button\" value=\" Greeting\" />" ,
55- button_to_function ( "Greeting" , "alert('Hello world!')" , :onclick => "alert('Goodbye World :(')" )
56+ assert_deprecated "button_to_function is deprecated and will be removed from Rails 4.0" do
57+ assert_dom_equal "<input onclick=\" alert('Goodbye World :('); alert('Hello world!');\" type=\" button\" value=\" Greeting\" />" ,
58+ button_to_function ( "Greeting" , "alert('Hello world!')" , :onclick => "alert('Goodbye World :(')" )
59+ end
5660 end
5761
5862 def test_button_to_function_without_function
59- assert_dom_equal "<input onclick=\" ;\" type=\" button\" value=\" Greeting\" />" ,
60- button_to_function ( "Greeting" )
63+ assert_deprecated "button_to_function is deprecated and will be removed from Rails 4.0" do
64+ assert_dom_equal "<input onclick=\" ;\" type=\" button\" value=\" Greeting\" />" ,
65+ button_to_function ( "Greeting" )
66+ end
6167 end
6268
6369 def test_link_to_function
64- assert_dom_equal %(<a href="#" onclick="alert('Hello world!'); return false;">Greeting</a>) ,
65- link_to_function ( "Greeting" , "alert('Hello world!')" )
70+ assert_deprecated "link_to_function is deprecated and will be removed from Rails 4.0" do
71+ assert_dom_equal %(<a href="#" onclick="alert('Hello world!'); return false;">Greeting</a>) ,
72+ link_to_function ( "Greeting" , "alert('Hello world!')" )
73+ end
6674 end
6775
6876 def test_link_to_function_with_existing_onclick
69- assert_dom_equal %(<a href="#" onclick="confirm('Sanity!'); alert('Hello world!'); return false;">Greeting</a>) ,
70- link_to_function ( "Greeting" , "alert('Hello world!')" , :onclick => "confirm('Sanity!')" )
77+ assert_deprecated "link_to_function is deprecated and will be removed from Rails 4.0" do
78+ assert_dom_equal %(<a href="#" onclick="confirm('Sanity!'); alert('Hello world!'); return false;">Greeting</a>) ,
79+ link_to_function ( "Greeting" , "alert('Hello world!')" , :onclick => "confirm('Sanity!')" )
80+ end
7181 end
7282
7383 def test_function_with_href
74- assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>) ,
75- link_to_function ( "Greeting" , "alert('Hello world!')" , :href => 'http://example.com/' )
84+ assert_deprecated "link_to_function is deprecated and will be removed from Rails 4.0" do
85+ assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>) ,
86+ link_to_function ( "Greeting" , "alert('Hello world!')" , :href => 'http://example.com/' )
87+ end
7688 end
7789
7890 def test_javascript_tag
0 commit comments