diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2019-02-06 08:55:23 +0200 |
---|---|---|
committer | Genadi Samokovarov <gsamokovarov@gmail.com> | 2019-04-19 14:15:41 +0900 |
commit | 769f73cc18c58021d49a3b93f1747568fe42ee5c (patch) | |
tree | 7ea62c89d042c3a69f50d151eb45f3135bbe6353 /actionpack/test | |
parent | 1820b197050251902e1ea6e9334181a78e4c1499 (diff) | |
download | rails-769f73cc18c58021d49a3b93f1747568fe42ee5c.tar.gz rails-769f73cc18c58021d49a3b93f1747568fe42ee5c.tar.bz2 rails-769f73cc18c58021d49a3b93f1747568fe42ee5c.zip |
Dispatch actions only if config.consider_all_requests_local is set
Diffstat (limited to 'actionpack/test')
-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: { |