Permalink
Browse files

Fix rake test warnings in actionpack

  • Loading branch information...
1 parent f5ecb13 commit c23f3aa7c03feece8232245d2e135a7375571f5c @MacksMind MacksMind committed Mar 17, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −1 actionpack/lib/action_view/template.rb
  2. +1 −1 actionpack/test/controller/test_case_test.rb
@@ -324,7 +324,8 @@ def handle_render_error(view, e) #:nodoc:
end
def locals_code #:nodoc:
- @locals.map { |key| "#{key} = local_assigns[:#{key}];" }.join
+ # Double assign to suppress the dreaded 'assigned but unused variable' warning
+ @locals.map { |key| "#{key} = #{key} = local_assigns[:#{key}];" }.join
end
def method_name #:nodoc:
@@ -58,7 +58,7 @@ def test_protocol
end
def test_headers
- render text: JSON.dump(request.headers.env)
+ render text: request.headers.env.to_json
end
def test_html_output

0 comments on commit c23f3aa

Please sign in to comment.