mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fix alias_method, add test
This commit is contained in:
@@ -58,7 +58,7 @@ module ActionView
|
||||
end
|
||||
end
|
||||
|
||||
alias_method :escape_javascript, :j
|
||||
alias_method :j, :escape_javascript
|
||||
|
||||
# Returns a JavaScript tag with the +content+ inside. Example:
|
||||
# javascript_tag "alert('All is good')"
|
||||
|
||||
@@ -27,6 +27,7 @@ class JavaScriptHelperTest < ActionView::TestCase
|
||||
assert_equal %(This \\"thing\\" is really\\n netos\\'), escape_javascript(%(This "thing" is really\n netos'))
|
||||
assert_equal %(backslash\\\\test), escape_javascript( %(backslash\\test) )
|
||||
assert_equal %(dont <\\/close> tags), escape_javascript(%(dont </close> tags))
|
||||
assert_equal %(dont <\\/close> tags), j(%(dont </close> tags))
|
||||
end
|
||||
|
||||
def test_button_to_function
|
||||
|
||||
Reference in New Issue
Block a user