From 882714a5baf1caaa2158eeb88fc30ab1897f80b3 Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Sat, 8 Aug 2009 15:40:08 -0400 Subject: [PATCH] test ensuring redirect_to uses the given protocol [#2886] --- actionpack/test/controller/redirect_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index c457486..3c44467 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -32,6 +32,10 @@ class RedirectController < ActionController::Base redirect_to({:action => "hello_world"}, {:status => 301}) end + def redirect_with_protocol + redirect_to :action => "hello_world", :protocol => "https" + end + def url_redirect_with_status redirect_to("http://www.example.com", :status => :moved_permanently) end @@ -130,6 +134,12 @@ class RedirectTest < ActionController::TestCase assert_equal "http://test.host/redirect/hello_world", redirect_to_url end + def test_redirect_with_protocol + get :redirect_with_protocol + assert_response 302 + assert_equal "https://test.host/redirect/hello_world", redirect_to_url + end + def test_url_redirect_with_status get :url_redirect_with_status assert_response 301 -- 1.6.2.2