diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-28 23:21:51 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-28 23:21:51 +0100 |
commit | caa6fb3eb40e40b7c7487a1815482951cd162d7a (patch) | |
tree | ad5c556dd39f8bbf7a51c92cb8c253936c3f1090 /actionpack/test | |
parent | d44a3c0505ea95c27380f4df24807f3e1836f4e6 (diff) | |
parent | 97b9e32d236bba5c5b2e18c1781066fa94b9f885 (diff) | |
download | rails-caa6fb3eb40e40b7c7487a1815482951cd162d7a.tar.gz rails-caa6fb3eb40e40b7c7487a1815482951cd162d7a.tar.bz2 rails-caa6fb3eb40e40b7c7487a1815482951cd162d7a.zip |
Merge pull request #22591 from gregmolnar/ssl
add `constraint_to` option to SSL middleware
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/ssl_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index 18ff894b31..bb2125e485 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -39,6 +39,13 @@ 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/ } } + + assert_not_redirected 'http://example.org/healthcheck', redirect: constraining + assert_redirected from: 'http://example.org/', redirect: constraining + end + test 'https is not redirected' do assert_not_redirected 'https://example.org' end |