diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-05 23:40:56 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-05 23:40:56 +0100 |
commit | e55d70a380a8d7408cc495086ff49af6c6e406d0 (patch) | |
tree | ba3a1d2d1827e15ef26a7ac59b2429d6454821fe /actionpack/test/dispatch | |
parent | b3900a29eb89b6b4613966c03282997fcc0cd6ac (diff) | |
download | rails-e55d70a380a8d7408cc495086ff49af6c6e406d0.tar.gz rails-e55d70a380a8d7408cc495086ff49af6c6e406d0.tar.bz2 rails-e55d70a380a8d7408cc495086ff49af6c6e406d0.zip |
redirect in routes takes port into account [#3653 status:resolved]
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 21bd7d5ac0..a746c7e2ed 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -507,6 +507,18 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_redirect_with_port + previous_host, self.host = self.host, 'www.example.com:3000' + with_test_routes do + get '/account/login' + assert_equal 301, @response.status + assert_equal 'http://www.example.com:3000/login', @response.headers['Location'] + assert_equal 'Moved Permanently', @response.body + end + ensure + self.host = previous_host + end + private def with_test_routes real_routes, temp_routes = ActionController::Routing::Routes, Routes |