diff options
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/actionable_exceptions_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/actionable_exceptions_test.rb b/actionpack/test/dispatch/actionable_exceptions_test.rb index 46979ed878..ae382e201e 100644 --- a/actionpack/test/dispatch/actionable_exceptions_test.rb +++ b/actionpack/test/dispatch/actionable_exceptions_test.rb @@ -38,6 +38,16 @@ class ActionableExceptionsTest < ActionDispatch::IntegrationTest assert_equal "/", response.headers["Location"] end + test "cannot dispatch errors if not allowed" do + post ActionDispatch::ActionableExceptions.endpoint, params: { + error: ActionError.name, + action: "Successful action", + location: "/", + }, headers: { "action_dispatch.show_exceptions" => false } + + assert_empty Actions + end + test "dispatched action can fail" do assert_raise RuntimeError do post ActionDispatch::ActionableExceptions.endpoint, params: { |