aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Suggs <aaron@ktheory.com>2012-03-25 21:16:29 -0400
committerPiotr Sarnacki <drogus@gmail.com>2012-03-28 13:31:37 +0200
commit0c525f68f221189dfd63916180f6b5a5b66bea5f (patch)
treef07d53fc7ff2bd918c927db5ec54b2277c3080a3 /actionpack
parent0560ce0b2928afce0c1ca9507b706ede8fd45138 (diff)
downloadrails-0c525f68f221189dfd63916180f6b5a5b66bea5f.tar.gz
rails-0c525f68f221189dfd63916180f6b5a5b66bea5f.tar.bz2
rails-0c525f68f221189dfd63916180f6b5a5b66bea5f.zip
Add test for default_url_options[:port]
Diffstat (limited to 'actionpack')
-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 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',