aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_for_test.rb
diff options
context:
space:
mode:
authorGuilherme Cavalcanti <guiocavalcanti@gmail.com>2014-05-09 15:52:10 -0300
committerAndrew White <andyw@pixeltrix.co.uk>2014-05-11 12:59:37 +0100
commitbe93d94ef28421a2dbcd6ed870b454433a5a0a72 (patch)
tree145c7211fe35e5cb305b6013733495322bebdb86 /actionpack/test/controller/url_for_test.rb
parentadcba34c57adba61bfaf45296a6dc707c8338b99 (diff)
downloadrails-be93d94ef28421a2dbcd6ed870b454433a5a0a72.tar.gz
rails-be93d94ef28421a2dbcd6ed870b454433a5a0a72.tar.bz2
rails-be93d94ef28421a2dbcd6ed870b454433a5a0a72.zip
ActionDispatch::Http::URL.normalize_port should not strip port for protocol relative URL.
Diffstat (limited to 'actionpack/test/controller/url_for_test.rb')
-rw-r--r--actionpack/test/controller/url_for_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index a8035e5bd7..0c6df16325 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -169,6 +169,18 @@ module AbstractController
)
end
+ def test_without_protocol_and_with_port
+ add_host!
+ add_port!
+
+ assert_equal('//www.basecamphq.com:3000/c/a/i',
+ W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => '//')
+ )
+ assert_equal('//www.basecamphq.com:3000/c/a/i',
+ W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => false)
+ )
+ end
+
def test_trailing_slash
add_host!
options = {:controller => 'foo', :trailing_slash => true, :action => 'bar', :id => '33'}