aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/action_pack_assertions_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-08-06 08:37:25 +0000
committerJamis Buck <jamis@37signals.com>2005-08-06 08:37:25 +0000
commit50e247443371630e03cb360867770170a76ecb8b (patch)
treeb1fa8948ded0f06fa573247882c03c617fb1c9b2 /actionpack/test/controller/action_pack_assertions_test.rb
parenta3469cadadfd770ad9029f651f3a51560bbd3045 (diff)
downloadrails-50e247443371630e03cb360867770170a76ecb8b.tar.gz
rails-50e247443371630e03cb360867770170a76ecb8b.tar.bz2
rails-50e247443371630e03cb360867770170a76ecb8b.zip
Make assert_redirected_to properly check URL's passed as strings #1910 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1971 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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