From 0c525f68f221189dfd63916180f6b5a5b66bea5f Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Sun, 25 Mar 2012 21:16:29 -0400 Subject: Add test for default_url_options[:port] --- actionpack/test/controller/url_for_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index 288efbf7c3..aa233d6135 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -16,6 +16,10 @@ module AbstractController W.default_url_options[:host] = 'www.basecamphq.com' end + def add_port! + W.default_url_options[:port] = 3000 + end + def add_numeric_host! W.default_url_options[:host] = '127.0.0.1' end @@ -121,6 +125,14 @@ module AbstractController ) end + def test_default_port + add_host! + add_port! + assert_equal('http://www.basecamphq.com:3000/c/a/i', + W.new.url_for(:controller => 'c', :action => 'a', :id => 'i') + ) + end + def test_protocol add_host! assert_equal('https://www.basecamphq.com/c/a/i', -- cgit v1.2.3