aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/base_test.rb16
-rw-r--r--actionpack/test/controller/force_ssl_test.rb6
2 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index 6e13aab518..777ca11d85 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -257,6 +257,22 @@ class UrlOptionsTest < ActionController::TestCase
assert_equal '/special', rs.url_for(url_params)
end
+ def test_url_for_query_params_included
+ rs = ActionDispatch::Routing::RouteSet.new
+ rs.draw do
+ match 'home' => 'pages#home'
+ end
+
+ options = {
+ :action => "home",
+ :controller => "pages",
+ :only_path => true,
+ :params => { "token" => "secret" }
+ }
+
+ assert_equal '/home?token=secret', rs.url_for(options)
+ end
+
def test_url_options_override
with_routing do |set|
set.draw do
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