Integration test url options should account for :protocol not just https?

This commit is contained in:
Jeremy Kemper
2010-03-15 19:26:58 -07:00
parent dcf1441c0f
commit 2a50eabf45
2 changed files with 8 additions and 9 deletions

View File

@@ -177,14 +177,8 @@ module ActionDispatch
reset!
end
def url_options
opts = super.reverse_merge(
:host => host,
:protocol => https? ? "https" : "http"
)
opts.merge!(:port => 443) if !opts.key?(:port) && https?
opts
def default_url_options
{ :host => host, :protocol => https? ? "https" : "http" }
end
# Resets the instance. This can be used to reset the state information

View File

@@ -34,5 +34,10 @@ module TestUrlGeneration
get "/foo", {}, 'SCRIPT_NAME' => "/new"
assert_equal "/new/foo", response.body
end
test "handling http protocol with https set" do
https!
assert_equal "http://www.example.com/bar/foo", foo_url(:protocol => "http")
end
end
end
end