diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-19 19:19:58 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-19 19:19:58 +0000 |
commit | d3704f888b4da86d2aa48b8efb777bd38f1e7028 (patch) | |
tree | 62f479b039534d8231392f61554fbbf14000ecc3 /actionpack/test | |
parent | 4a7225a1bdf693af9e0e22bec5b61061179fdb1f (diff) | |
download | rails-d3704f888b4da86d2aa48b8efb777bd38f1e7028.tar.gz rails-d3704f888b4da86d2aa48b8efb777bd38f1e7028.tar.bz2 rails-d3704f888b4da86d2aa48b8efb777bd38f1e7028.zip |
Fixed assert_redirect_to to work with redirect_to_path #869 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1332 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 4823983165..3fc8a2c99a 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -19,6 +19,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 + # a redirect to an external location def redirect_external() redirect_to_url "http://www.rubyonrails.org"; end @@ -368,6 +370,19 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase assert_raises(RuntimeError, "Can't follow redirects outside of current controller (elsewhere)") { follow_redirect } end + + def test_redirected_to_url_leadling_slash + process :redirect_to_path + assert_redirected_to '/some/path' + end + def test_redirected_to_url_no_leadling_slash + process :redirect_to_path + assert_redirected_to 'some/path' + end + def test_redirected_to_url_full_url + process :redirect_to_path + assert_redirected_to 'http://test.host/some/path' + end end class ActionPackHeaderTest < Test::Unit::TestCase @@ -384,4 +399,4 @@ class ActionPackHeaderTest < Test::Unit::TestCase process :hello_xml_world assert_equal('application/pdf', @controller.headers['Content-Type']) end -end
\ No newline at end of file +end |