@@ -46,33 +46,45 @@ def test_escape_javascript_with_safebuffer
46
46
end
47
47
48
48
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
51
53
end
52
54
53
55
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
56
60
end
57
61
58
62
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
61
67
end
62
68
63
69
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
66
74
end
67
75
68
76
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
71
81
end
72
82
73
83
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
76
88
end
77
89
78
90
def test_javascript_tag
0 commit comments