Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for default_url_options[:port]

  • Loading branch information...
commit 0c525f68f221189dfd63916180f6b5a5b66bea5f 1 parent 0560ce0
@ktheory ktheory authored drogus committed
Showing with 12 additions and 0 deletions.
  1. +12 −0 actionpack/test/controller/url_for_test.rb
View
12 actionpack/test/controller/url_for_test.rb
@@ -16,6 +16,10 @@ def add_host!
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 @@ def test_port
)
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',

0 comments on commit 0c525f6

Please sign in to comment.
Something went wrong with that request. Please try again.