aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware_test.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-03-27 23:55:46 +0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-03-27 13:27:23 -0700
commit2c0c4d754e34b13379dfc53121a970c25fab5dae (patch)
treea911462aeb8f1bd2e8df9d255708d074cfdf37ce /railties/test/application/middleware_test.rb
parentb2d94322e6f2c2324154465147938ca8b16c610d (diff)
downloadrails-2c0c4d754e34b13379dfc53121a970c25fab5dae.tar.gz
rails-2c0c4d754e34b13379dfc53121a970c25fab5dae.tar.bz2
rails-2c0c4d754e34b13379dfc53121a970c25fab5dae.zip
Add `config.force_ssl` configuration which will load `Rack::SSL` middleware if set to true
This will allow user to be able to force all requests to be under HTTPS protocol. This commit was a request from DHH. Special thanks to Josh Peek as well for making `Rack::SSL`.
Diffstat (limited to 'railties/test/application/middleware_test.rb')
-rw-r--r--railties/test/application/middleware_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index b314832685..0df6f33e8c 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -52,6 +52,12 @@ module ApplicationTests
assert_equal "Rack::Cache", middleware.first
end
+ test "Rack::SSL is present with force_ssl is set" do
+ add_to_config "config.force_ssl = true"
+ boot!
+ assert middleware.include?("Rack::SSL")
+ end
+
test "removing Active Record omits its middleware" do
use_frameworks []
boot!