aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/action_pack_assertions_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/action_pack_assertions_test.rb')
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index e7faeb25cd..917ae330b6 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -20,6 +20,8 @@ class ActionPackAssertionsController < ActionController::Base
def redirect_to_controller() redirect_to :controller => "elsewhere", :action => "flash_me"; end
def redirect_to_path() redirect_to '/some/path' end
+
+ def redirect_to_named_route() redirect_to route_one_url end
# a redirect to an external location
def redirect_external() redirect_to_url "http://www.rubyonrails.org"; end
@@ -185,6 +187,14 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
process :redirect_external
assert_redirect_url_match /ruby/
end
+
+ # test the redirection to a named route
+ def test_assert_redirect_to_named_route
+ process :redirect_to_named_route
+ assert_raise(Test::Unit::AssertionFailedError) do
+ assert_redirected_to 'http://test.host/route_two'
+ end
+ end
# test the flash-based assertions with something is in the flash
def test_flash_assertions_full