Browse files

Merge pull request #15712 from zuhao/refactor_actionview_javascript_h…

…elper_test

Avoid hard-coded value in test setup and teardown.
  • Loading branch information...
2 parents a041107 + 0da1c80 commit 534e1e1f53c77430c7e169661da28d6e9c1927ce @senny senny committed Jun 14, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionview/test/template/javascript_helper_test.rb
View
6 actionview/test/template/javascript_helper_test.rb
@@ -12,14 +12,14 @@ def update_details(details)
yield if block_given?
end
- def setup
- super
+ setup do
+ @old_escape_html_entities_in_json = ActiveSupport.escape_html_entities_in_json
ActiveSupport.escape_html_entities_in_json = true
@template = self
end
def teardown
- ActiveSupport.escape_html_entities_in_json = false
+ ActiveSupport.escape_html_entities_in_json = @old_escape_html_entities_in_json
end
def test_escape_javascript

0 comments on commit 534e1e1

Please sign in to comment.