aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRonak Jangir <ronakjangir47@gmail.com>2015-09-21 22:02:03 +0530
committerRonak Jangir <ronakjangir47@gmail.com>2015-09-21 22:02:03 +0530
commit58ec903cd4eb9790d1a757a9d680d03d801d794d (patch)
treee04192ea054921574cc94707b7e68b56b80cfd61 /actionpack
parent56a8b40b400169fd9d96856721d0bbb01dbfaa64 (diff)
downloadrails-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')
-rw-r--r--actionpack/test/controller/redirect_test.rb6
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