aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/force_ssl_test.rb
diff options
context:
space:
mode:
authorRyan McGeary <ryan@mcgeary.org>2012-02-06 17:47:17 -0500
committerRyan McGeary <ryan@mcgeary.org>2012-02-06 17:47:17 -0500
commit391e6a47dbd46fdce0a472819e8d27792cc91984 (patch)
treec6959229ef34ce1155100d7aeb14225315f6daf8 /actionpack/test/controller/force_ssl_test.rb
parentdd54137e82852ce3a62ce20ecc8550f1ca3a9f96 (diff)
downloadrails-391e6a47dbd46fdce0a472819e8d27792cc91984.tar.gz
rails-391e6a47dbd46fdce0a472819e8d27792cc91984.tar.bz2
rails-391e6a47dbd46fdce0a472819e8d27792cc91984.zip
Fixed force_ssl redirects to include original query params
`ActionController.force_ssl` redirects http URLs to their https equivalent; however, when a URL contains a query string, the resulting redirect lacked the original query string.
Diffstat (limited to 'actionpack/test/controller/force_ssl_test.rb')
-rw-r--r--actionpack/test/controller/force_ssl_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/force_ssl_test.rb b/actionpack/test/controller/force_ssl_test.rb
index 43b20fdead..3cbc111ebb 100644
--- a/actionpack/test/controller/force_ssl_test.rb
+++ b/actionpack/test/controller/force_ssl_test.rb
@@ -35,6 +35,12 @@ class ForceSSLControllerLevelTest < ActionController::TestCase
assert_equal "https://test.host/force_ssl_controller_level/banana", redirect_to_url
end
+ def test_banana_redirects_to_https_with_extra_params
+ get :banana, :token => "secret"
+ assert_response 301
+ assert_equal "https://test.host/force_ssl_controller_level/banana?token=secret", redirect_to_url
+ end
+
def test_cheeseburger_redirects_to_https
get :cheeseburger
assert_response 301