From 493313228aab26a7e8a241c1be2a73d52ba60f0d Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Thu, 3 Mar 2016 21:09:58 +0100 Subject: Rename constrain_to to exclude. `ActionDispatch::SSL` redirects all HTTP requests to HTTPS, not just some. The `constrain_to` option inverts this, so it sounds like the middleware only handles a few requests, rather than the majority with a few routes to opt out of the redirect. Renaming to `exclude` matches this intent more closely. --- actionpack/test/dispatch/ssl_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index bb2125e485..668b2b6cfe 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -39,11 +39,11 @@ class RedirectSSLTest < SSLTest assert_equal redirect[:body].join, @response.body end - test 'constrain to can avoid redirect' do - constraining = { constrain_to: -> request { request.path !~ /healthcheck/ } } + test 'exclude can avoid redirect' do + excluding = { exclude: -> request { request.path =~ /healthcheck/ } } - assert_not_redirected 'http://example.org/healthcheck', redirect: constraining - assert_redirected from: 'http://example.org/', redirect: constraining + assert_not_redirected 'http://example.org/healthcheck', redirect: excluding + assert_redirected from: 'http://example.org/', redirect: excluding end test 'https is not redirected' do -- cgit v1.2.3