Skip to content

Commit

Permalink
Add test for default_url_options[:port]
Browse files Browse the repository at this point in the history
  • Loading branch information
ktheory authored and drogus committed Mar 28, 2012
1 parent 0560ce0 commit 0c525f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions actionpack/test/controller/url_for_test.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 0c525f6

Please sign in to comment.