aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSeth Fitzsimmons <seth@mojodna.net>2008-10-30 12:03:47 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-10-30 21:07:50 +0100
commit47b4fa4a621ee48ab17545b1e9fb38efef53b28e (patch)
tree2cf5c92154ff0cdefb4b09e16cb788802369cb4b /actionpack/test
parentef53d915164da7f757d03c4a70fe38e374c08b14 (diff)
downloadrails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.tar.gz
rails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.tar.bz2
rails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.zip
Fixed regex in redirect_to to fully support URI schemes [#1247 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/redirect_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index 2f8bf7b6ee..c55307d645 100644
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
@@ -73,6 +73,10 @@ class RedirectController < ActionController::Base
redirect_to "http://dev.rubyonrails.org/query?status=new"
end
+ def redirect_to_url_with_complex_scheme
+ redirect_to "x-test+scheme.complex:redirect"
+ end
+
def redirect_to_back
redirect_to :back
end
@@ -198,6 +202,12 @@ class RedirectTest < Test::Unit::TestCase
assert_redirected_to "http://dev.rubyonrails.org/query?status=new"
end
+ def test_redirect_to_url_with_complex_scheme
+ get :redirect_to_url_with_complex_scheme
+ assert_response :redirect
+ assert_equal "x-test+scheme.complex:redirect", redirect_to_url
+ end
+
def test_redirect_to_back
@request.env["HTTP_REFERER"] = "http://www.example.com/coming/from"
get :redirect_to_back