diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 720890eeb9..946db1df79 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.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: diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 9c6d02a62d..38b9794b4d 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -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