aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rwxr-xr-xactionpack/test/controller/redirect_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index 571d5b1f5a..0e85347bad 100755
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
@@ -65,6 +65,14 @@ class RedirectController < ActionController::Base
redirect_to :action => "hello_world"
end
+ def redirect_to_url
+ redirect_to "http://www.rubyonrails.org/"
+ end
+
+ def redirect_to_url_with_unescaped_query_string
+ redirect_to "http://dev.rubyonrails.org/query?status=new"
+ end
+
def redirect_to_back
redirect_to :back
end
@@ -193,6 +201,18 @@ class RedirectTest < Test::Unit::TestCase
assert_equal "world", assigns["hello"]
end
+ def test_redirect_to_url
+ get :redirect_to_url
+ assert_response :redirect
+ assert_redirected_to "http://www.rubyonrails.org/"
+ end
+
+ def test_redirect_to_url_with_unescaped_query_string
+ get :redirect_to_url_with_unescaped_query_string
+ assert_response :redirect
+ assert_redirected_to "http://dev.rubyonrails.org/query?status=new"
+ end
+
def test_redirect_to_back
@request.env["HTTP_REFERER"] = "http://www.example.com/coming/from"
get :redirect_to_back