mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix alias_method, add test
This commit is contained in:
parent
a9d27c04ab
commit
cc6fa2f4d7
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue