diff options
author | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-21 22:02:03 +0530 |
---|---|---|
committer | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-21 22:02:03 +0530 |
commit | 58ec903cd4eb9790d1a757a9d680d03d801d794d (patch) | |
tree | e04192ea054921574cc94707b7e68b56b80cfd61 /actionpack/test/controller | |
parent | 56a8b40b400169fd9d96856721d0bbb01dbfaa64 (diff) | |
download | rails-58ec903cd4eb9790d1a757a9d680d03d801d794d.tar.gz rails-58ec903cd4eb9790d1a757a9d680d03d801d794d.tar.bz2 rails-58ec903cd4eb9790d1a757a9d680d03d801d794d.zip |
Added assertion for error messages for redirection to nil and params
As both `redirect_to_nil` and `redirect_to_params` are raising same `ActionController::ActionControllerError` so it’s good to assert error messages as well
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/redirect_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index 91b30ede6a..631ff7d02a 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -266,15 +266,17 @@ class RedirectTest < ActionController::TestCase end def test_redirect_to_nil - assert_raise(ActionController::ActionControllerError) do + error = assert_raise(ActionController::ActionControllerError) do get :redirect_to_nil end + assert_equal "Cannot redirect to nil!", error.message end def test_redirect_to_params - assert_raise(ActionController::ActionControllerError) do + error = assert_raise(ActionController::ActionControllerError) do get :redirect_to_params end + assert_equal "Cannot redirect to a parameter hash!", error.message end def test_redirect_to_with_block |