From 083f657c0f1990e980d33f89f44d8943a9270475 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Mon, 1 Dec 2014 17:45:33 -0500 Subject: Refactor debug view Avoid logic in ERB and use helpers --- actionpack/test/dispatch/debug_exceptions_test.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/debug_exceptions_test.rb b/actionpack/test/dispatch/debug_exceptions_test.rb index 5e87744f6b..1e5ed60b09 100644 --- a/actionpack/test/dispatch/debug_exceptions_test.rb +++ b/actionpack/test/dispatch/debug_exceptions_test.rb @@ -241,6 +241,29 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest assert_match(/RuntimeError\n\s+in FeaturedTileController/, body) end + test "show formatted params" do + @app = DevelopmentApp + + params = { + 'id' => 'unknown', + 'someparam' => { + 'foo' => 'bar', + 'abc' => 'goo' + } + } + + get("/runtime_error", {}, { + 'action_dispatch.show_exceptions' => true, + 'action_dispatch.request.parameters' => { + 'action' => 'show', + 'controller' => 'featured_tile' + }.merge(params) + }) + assert_response 500 + + assert_includes(body, CGI.escapeHTML(PP.pp(params, "", 200))) + end + test "sets the HTTP charset parameter" do @app = DevelopmentApp -- cgit v1.2.3