diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-04-17 18:55:21 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-04-18 18:57:13 -0400 |
commit | 93034ad7fea7e00562103a7cd0acfab19bbfadf9 (patch) | |
tree | 9cba660f6dd0e0c26cf9de8ecf0a818c5a87970f /actionpack/test/controller | |
parent | 70c6fb1a06d76d0d6cddb6fb50137aa1341745a0 (diff) | |
download | rails-93034ad7fea7e00562103a7cd0acfab19bbfadf9.tar.gz rails-93034ad7fea7e00562103a7cd0acfab19bbfadf9.tar.bz2 rails-93034ad7fea7e00562103a7cd0acfab19bbfadf9.zip |
Reuse the Parameters#to_h check in the routing helpers
Since this protection is now in Parameters we can use it instead of
reimplementing again.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/redirect_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index f06a1f4d23..5b16af78c4 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -285,10 +285,10 @@ class RedirectTest < ActionController::TestCase end def test_redirect_to_params - error = assert_raise(ArgumentError) do + error = assert_raise(ActionController::UnfilteredParameters) do get :redirect_to_params end - assert_equal ActionDispatch::Routing::INSECURE_URL_PARAMETERS_MESSAGE, error.message + assert_equal "unable to convert unpermitted parameters to hash", error.message end def test_redirect_to_with_block diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index 862dcf01c3..2afe67ed91 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -386,7 +386,7 @@ module AbstractController def test_url_action_controller_parameters add_host! - assert_raise(ArgumentError) do + assert_raise(ActionController::UnfilteredParameters) do W.new.url_for(ActionController::Parameters.new(controller: "c", action: "a", protocol: "javascript", f: "%0Aeval(name)")) end end |