1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test for default_url_options[:port]

This commit is contained in:
Aaron Suggs 2012-03-25 21:16:29 -04:00 committed by Piotr Sarnacki
parent 0560ce0b29
commit 0c525f68f2

View file

@ -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',