diff options
author | Tom Kadwill <tomkadwill@gmail.com> | 2016-05-12 07:05:41 +0100 |
---|---|---|
committer | Tom Kadwill <tomkadwill@gmail.com> | 2016-05-12 18:46:16 +0100 |
commit | 775703e1f9b99500ecc362fd0eef5212b3580619 (patch) | |
tree | 3afab0dc2b713867a689efed603ac008ad239a84 /actionpack/test | |
parent | 548c1d6e8b819ca4e02e6218b67107c580ee65f2 (diff) | |
download | rails-775703e1f9b99500ecc362fd0eef5212b3580619.tar.gz rails-775703e1f9b99500ecc362fd0eef5212b3580619.tar.bz2 rails-775703e1f9b99500ecc362fd0eef5212b3580619.zip |
Document and test ActionDispatch server_port
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index 781f852633..8a5d85ab84 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -358,6 +358,17 @@ class RequestPort < BaseRequestTest request = stub_request 'HTTP_HOST' => 'www.example.org:8080' assert_equal ':8080', request.port_string end + + test "server port" do + request = stub_request 'SERVER_PORT' => '8080' + assert_equal 8080, request.server_port + + request = stub_request 'SERVER_PORT' => '80' + assert_equal 80, request.server_port + + request = stub_request 'SERVER_PORT' => '' + assert_equal 0, request.server_port + end end class RequestPath < BaseRequestTest |